Apparatus and method of improved extract instructions

ABSTRACT

An apparatus is described that includes instruction execution circuitry to execute first, second, third, and fourth instructions, the first and second instructions select a first group of input vector elements from one of multiple first non-overlapping sections of respective first and second input vectors. Each of the multiple first non-overlapping sections have a same bit width as the first group. Both the third and fourth instructions select a second group of input vector elements from one of multiple second non-overlapping sections of respective third and fourth input vectors. The second group has a second bit width that is larger than the first bit width. Each of multiple second non-overlapping sections have a same bit width as the second group. The apparatus includes masking layer circuitry to mask the first and second groups at a first granularity a second granularity.

CROSS-REFERENCE TO RELATED APPLICATIONS

The present patent application is a continuation application claimingpriority from U.S. patent application Ser. No. 13/976,998, whose §371(c)date is Jun. 27, 2013, and titled: “Apparatus and Method of ImprovedExtract Instructions”, which is a U.S. National Phase Application under35 U.S.C. §371 of International Application No. PCT/US2011/067182, filedDec. 23, 2011, and titled: “Apparatus and Method of Improved ExtractInstructions Background”, both of which are incorporated herein byreference in their entirety.

FIELD OF INVENTION

The present invention pertains to the computing sciences generally, and,more specifically to an apparatus and method of improved extractinstructions.

BACKGROUND

FIG. 1 shows a high level diagram of a processing core 100 implementedwith logic circuitry on a semiconductor chip. The processing coreincludes a pipeline 101. The pipeline consists of multiple stages eachdesigned to perform a specific step in the multi-step process needed tofully execute a program code instruction. These typically include atleast: 1) instruction fetch and decode; 2) data fetch; 3) execution; 4)write-back. The execution stage performs a specific operation identifiedby an instruction that was fetched and decoded in prior stage(s) (e.g.,in step 1) above) upon data identified by the same instruction andfetched in another prior stage (e.g., step 2) above). The data that isoperated upon is typically fetched from (general purpose) registerstorage space 102. New data that is created at the completion of theoperation is also typically “written back” to register storage space(e.g., at stage 4) above).

The logic circuitry associated with the execution stage is typicallycomposed of multiple “execution units” or “functional units” 103_1 to103_N that are each designed to perform its own unique subset ofoperations (e.g., a first functional unit performs integer mathoperations, a second functional unit performs floating pointinstructions, a third functional unit performs load/store operationsfrom/to cache/memory, etc.). The collection of all operations performedby all the functional units corresponds to the “instruction set”supported by the processing core 100.

Two types of processor architectures are widely recognized in the fieldof computer science: “scalar” and “vector”. A scalar processor isdesigned to execute instructions that perform operations on a single setof data, whereas, a vector processor is designed to execute instructionsthat perform operations on multiple sets of data. FIGS. 2A and 2Bpresent a comparative example that demonstrates the basic differencebetween a scalar processor and a vector processor.

FIG. 2A shows an example of a scalar AND instruction in which a singleoperand set, A and B, are ANDed together to produce a singular (or“scalar”) result C (i.e., AB=C). By contrast, FIG. 2B shows an exampleof a vector AND instruction in which two operand sets, A/B and D/E, arerespectively ANDed together in parallel to simultaneously produce avector result C, F (i.e., A.AND.B=C and D.AND.E=F). As a matter ofterminology, a “vector” is a data element having multiple “elements”.For example, a vector V=Q, R, S, T, U has five different elements: Q, R,S, T and U. The “size” of the exemplary vector V is five (because it hasfive elements).

FIG. 1 also shows the presence of vector register space 104 that isdifferent that general purpose register space 102. Specifically, generalpurpose register space 102 is nominally used to store scalar values. Assuch, when, the any of execution units perform scalar operations theynominally use operands called from (and write results back to) generalpurpose register storage space 102. By contrast, when any of theexecution units perform vector operations they nominally use operandscalled from (and write results back to) vector register space 107.Different regions of memory may likewise be allocated for the storage ofscalar values and vector values.

Note also the presence of masking logic 104_1 to 104_N and 105_1 to105_N at the respective inputs to and outputs from the functional units103_1 to 103_N. In various implementations, only one of these layers isactually implemented—although that is not a strict requirement. For anyinstruction that employs masking, input masking logic 104_1 to 104_Nand/or output masking logic 105_1 to 105_N may be used to control whichelements are effectively operated on for the vector instruction. Here, amask vector is read from a mask register space 106 (e.g., along withinput data vectors read from vector register storage space 107) and ispresented to at least one of the masking logic 104, 105 layers.

Over the course of executing vector program code each vector instructionneed not require a full data word. For example, the input vectors forsome instructions may only be 8 elements, the input vectors for otherinstructions may be 16 elements, the input vectors for otherinstructions may be 32 elements, etc. Masking layers 104/105 aretherefore used to identify a set of elements of a full vector data wordthat apply for a particular instruction so as to effect different vectorsizes across instructions. Typically, for each vector instruction, aspecific mask pattern kept in mask register space 106 is called out bythe instruction, fetched from mask register space and provided to eitheror both of the mask layers 104/105 to “enable” the correct set ofelements for the particular vector operation.

FIGS. 3a to 3e show the logical operation of prior art VINSERT, VEXTRACTand VPERMUTE instructions. Note that the names of the instructions havebeen abbreviated or otherwise simplified as compared to their actualname.

FIG. 3a shows the logical operation of a prior art VINSERT instruction.As observed in FIG. 3a , a first input operand corresponds to 128 bitsof information 301_A and a second input operand corresponds to a 256 bitvector 302_A. A third, immediate input operand (not shown) specifieswhich half (low half or right half) of the 256 bit vector 302_A is to bereplaced by the 128 bits of information of the first input operand301_A. The resulting structure is stored in a destination/result vectorhaving a size of 256 bits. The 128 bits of information 301, input vector302_A and result are floating point values that can be 32 bits or 64bits in size.

FIG. 3b shows the logical operation of a prior art VEXTRACT instruction.As observed in FIG. 3b , a first input operand corresponds to a 256 bitvector 301_B. A second, immediate input operand (not shown) specifieswhich half (low half or right half) of the 256 bit input vector 301_B isto be written over the lowest ordered 128 bits of a 256 bit vectorstored in a destination register 302_B. Input vector 301_B vector isstructured to be floating point values that are 32 bits or 64 bits insize. The instruction format may alternatively specify 128 bits inmemory as the destination rather than the destination register 302_B.

FIGS. 3c through 3e show the respective logical operations of threedifferent VPERMUTE instructions (VPERMILPS, VPERMILPD, VPERM2F128).

FIG. 3c shows the logical operation of the VPERMILPS instruction. Asobserved in FIG. 3c , the VPERMILPS instruction accepts an input operand301_C that corresponds to a 256 bit input vector having eight 32 bit(single precision) floating point values. The result is also a 256 bitvector having eight 32 bit single precision floating point values as itselements 302_C. A second input vector (not shown) uniquely specifies,for each of the four elements in the lower half of the result, which ofthe four elements 301_C_1 through 301_C_4 in the lower half of the inputvector 301_C is to provide the output element with its content.

FIG. 3c shows the operation for only output elements 302_C_1 and302_C_5. Here, the content of output element 302_C_1 can be “filled”with the content of any of input elements 301_C_1 through 301_C_4. Whichone of input elements 301_C_1 through 301_C_4 is selected to fill outputelement 302_C_1 is articulated in a (not shown) second input vector.Here, the second input vector contains a separate 2 bit control fieldfor each of the eight elements in the output vector. The source for anoutput element in the lower half of the result 302_C must be chosen fromthe lower half of input vector 301_C Likewise, the source for an outputelement in the upper half of the result 302_C must be chosen from theupper half of input vector 301_C.

Although not explicitly shown in FIG. 3c , the content of each of outputelements 302_C_2 through 302_C_4 are uniquely specified as any of inputelements 301_C_1 through 301_C_4 by way of the information contained inthe second input vector. Similarly, as observed in FIG. 3c , the contentof output element 302_C_5 is “filled” with the content of any of inputelements 301_C_5 through 301_C_8. Again, which one of input elements301_C_5 through 301_C_8 is selected to fill output element 302_C_5 isalso articulated in the (not shown) second input vector. The content ofeach of output elements 302_C_6 through 302_C_8 is uniquely specified asany of input elements 301_C_5 through 301_C_8 by the (not shown) secondinput vector.

Another version of the VPERMILPS instruction uses an immediate operandinstead of the second input vector to choose the selection pattern ofthe input vector 301_C. Here, the input element selection pattern forthe lower half of the destination matches the input element selectionpattern for the upper half of the destination.

FIG. 3d shows the logical operation of the VPERMILPD instruction. Asobserved in FIG. 3d , the VPERMILPD instruction accepts an input operand301_D that corresponds to a 256 bit input vector having four 64 bit(double precision) floating point values. The result is also a 256 bitvector 302_D having four 64 bit double precision floating point valuesas its elements. A second input vector (not shown) uniquely specifies,for each of the two elements in the lower half of the result, which ofthe two elements 301_D_1 through 301_D_2 in the lower half of the inputvector 301_D is to provide the output element with its content.

As observed in FIG. 3d , each of output elements 302_D_1 and 302_D_2 canbe uniquely “filled” with either of input elements 301_D_1 or 301_D_2.Likewise, each of output elements 302_D_3 and 302_D_4 can be uniquely“filled” with either of input elements 301_D_3 or 301_C_4. Which inputelement is selected to fill a specific output element is articulated ina (not shown) second input vector. Here, the second input vectorcontains a separate 2 bit control field for each of the four elements inthe output vector.

Another version of the VPERMILPD instruction uses an immediate operandinstead of the second input vector to choose the selection pattern ofthe input vector 301_D. Here, the input element selection pattern forthe lower half of the destination matches the input element selectionpattern for the upper half of the destination.

For both the VPERMIPLS and VPERMIPLD instructions, the result is storedin a vector register specified in the instruction format of theinstruction. The source of the first input vector is specified in theinstruction format and corresponds to a vector register when the secondinput vector is utilized to determine the selection pattern. In thiscase, the source of the second input vector is also specified in theinstruction format and corresponds to either a second vector register ora memory location. By contrast, if the immediate operand is used todetermine the selection pattern, the source of the first input vector isspecified in the instruction format and may be a vector register or amemory location.

FIG. 3e shows the logical operation of the VPERM2F128 instruction. Asobserved in FIG. 3e , the VPERM2F128 instruction accepts two separate256 bit vector input operands 301_E, 302_E. Both the lower and upper 128bit halves 303_E_1, 303_E_2 of a 256 bit result 303_E can be filled withany of the lower or upper halves 301_E_1, 301_E_2, 302_E_1, 302_E_2 ofboth input vectors 301_E, 302_E. The result is stored in a vectorregister specified in the instruction format of the instruction. Thesources of both input vectors 301_E, 302_E are specified in theinstruction format and may correspond to a pair of vector registers orone vector register and one memory location.

BRIEF DESCRIPTION OF THE DRAWINGS

The present invention is illustrated by way of example and notlimitation in the figures of the accompanying drawings, in which likereferences indicate similar elements and in which:

FIG. 1 shows an instruction execution pipeline;

FIGS. 2A and 2B compare scalar vs. vector processing;

FIGS. 3A through 3E show prior art insert, extract and permuteinstructions;

FIGS. 4A through 4P show improved insert, extract and permuteinstructions;

FIGS. 5A and 5B pertain to execution logic circuitry for implementingthe improved insert, extract and permute instructions;

FIGS. 6A-6B are block diagrams illustrating a generic vector friendlyinstruction format and instruction templates thereof according toembodiments of the invention;

FIGS. 7A-7D are block diagrams illustrating an exemplary specific vectorfriendly instruction format according to embodiments of the invention;

FIG. 8 is a block diagram of a register architecture according to oneembodiment of the invention;

FIG. 9A is a block diagram illustrating both an exemplary in-orderpipeline and an exemplary register renaming, out-of-orderissue/execution pipeline according to embodiments of the invention;

FIG. 9B is a block diagram illustrating both an exemplary embodiment ofan in-order architecture core and an exemplary register renaming,out-of-order issue/execution architecture core to be included in aprocessor according to embodiments of the invention;

FIGS. 10A-B illustrate a block diagram of a more specific exemplaryin-order core architecture, which core would be one of several logicblocks (including other cores of the same type and/or different types)in a chip;

FIG. 11 is a block diagram of a processor that may have more than onecore, may have an integrated memory controller, and may have integratedgraphics according to embodiments of the invention;

FIG. 12 is a block diagram of a system in accordance with one embodimentof the present invention;

FIG. 13 is a block diagram of a first more specific exemplary system inaccordance with an embodiment of the present invention;

FIG. 14 is a block diagram of a second more specific exemplary system inaccordance with an embodiment of the present invention;

FIG. 15 is a block diagram of a SoC in accordance with an embodiment ofthe present invention; and

FIG. 16 is a block diagram contrasting the use of a software instructionconverter to convert binary instructions in a source instruction set tobinary instructions in a target instruction set according to embodimentsof the invention.

DETAILED DESCRIPTION Detailed Description

FIGS. 4a through 4e show the logic operation of four new VINSERTinstructions. Specifically, FIGS. 4a through 4d respectively show aVINSERTF32X4 instruction, a VINSERTF64X2 instruction, a VINSERTF32X8instruction and a VINSERTF64X4 instruction.

FIG. 4a shows the logic operation of a VINSERTF32X4 instruction. Asobserved in FIG. 4a , a 128 bit structure 401_A is received as a firstinput operand. The 128 bit structure contains four 32 bit singleprecision floating point values. A 512 bit vector is also received as asecond input operand 402_A. The 512 bit vector can be viewed as beingcomposed of four contiguous “chunks” of data, each of which are 128 bitsin size. An immediate operand (not shown), indicates which 128 bit“chunk” of the second operand 402_A is to be overwritten with the firstinput operand 401_A. To say that the second operand is overwritten istrue in the sense that the local copy in the execution unit of theinformation that was read from vector register space is overwritten. Asis well known in the art, original source information in vector registerspace is typically overwritten only if the instruction format indicatesthat a source register is also a destination register.

A mask is then applied to the resulting data structure 403_A. Here, amasking layer 404_A receives an input mask vector (not shown) thatidentifies which 32 bit data values of the resulting data structure403_A are to be written to the destination 406_A. Both the location ofthe mask vector in mask register space (e.g., such as mask registerspace 106 of FIG. 1), and, the location of the destination in vectorregister space are identified in the instruction format. The source ofthe first and second input operands 401_A, 402_A are also identified inthe instruction format. In an embodiment, the first input operand 401_Amay be sourced from vector register space or a memory location, and, thesecond input operand 402_A is sourced from vector register space. Theimmediate operand is also included in the instruction format. In anembodiment, the vector register space where the destination is stored isdifferent than the vector register space from where the input operandsare sourced.

In an embodiment, rather than read the mask from mask register space,the mask is embedded in the instruction itself (e.g., akin to animmediate operand). In this case, the instruction format includes afield that contains the actual mask pattern. By contrast, if the mask isfetched from mask register space, the instruction format includes anaddress field that identifies from where the mask pattern is stored inmask register space. For simplicity the discussion of the remainingdiscussions below are written as if the mask is fetched from maskregister space. However, the reader should understand that theinstructions could also be implemented with the mask embedded in theinstruction as a kind of immediate operand.

In an implementation of a vector friendly instruction format,embodiments of which are described in more detail below, the instructionformat supports both of these mask pattern techniques. In this case, theinstruction format includes an additional field that identifies whichapproach is to be taken for the instruction (e.g., 1=mask pattern isakin to immediate operand embedded in the instruction, 0=mask pattern isto be fetched from mask register space).

Separately or in combination, the type of masking applied may be“merged” or “zeroed”. In the case of merged masking, a “masked out”field of the resultant data structure is not written over. Rather, theoriginal value in the destination register at that location is kept. Bycontrast, in the case of zeroed masking, a “masked out” field of theresultant data structure writes over that location in the destinationregister with a value of 0. In various embodiments (such as thoseassociated with the vector friendly instruction format referred to justabove), whether merged or zeroed masking to apply is specified inanother field of the instruction format.

The above comments concerning masking also apply to the followingdiscussion of the instructions associated with FIGS. 4b through 4p . Forconvenience they are not repeated below.

FIG. 4b shows the logic operation of a VINSERTF64X2 instruction. Asobserved in FIG. 4b , a 128 bit structure 401_B is received as a firstinput operand. The 128 bit structure contains two 64 bit doubleprecision floating point values. A 512 bit vector is also received as asecond input operand 402_B. The 512 bit vector can be viewed as beingcomposed of four contiguous “chunks” of data, each of which are 128 bitsin size. An immediate operand (not shown), indicates which 128 bit“chunk” of the second operand 402_B is to be overwritten with the firstinput operand 401_B.

A mask is then applied to the resulting data structure 403_B. Here, amasking layer 404_B receives an input mask vector (not shown) thatidentifies which 64 bit data values of the resulting data structure403_B are to be written to the destination 406_B. Both the location ofthe mask vector in mask register space, and, the location of thedestination in vector register space are identified in the instructionformat. The source of the first and second input operands 401_B, 402_Bare also identified in the instruction format. In an embodiment, thefirst input operand 401_B may be sourced from vector register space or amemory location, and, the second input operand 402_B is sourced fromvector register space. The immediate operand is also included in theinstruction format. In an embodiment, the vector register space wherethe destination is stored is different than the vector register spacefrom where the input operands are sourced.

FIG. 4c shows the logic operation of a VINSERTF32X8 instruction. Asobserved in FIG. 4c , a 256 bit structure 401_C is received as a firstinput operand. The 256 bit structure contains eight 32 bit singleprecision floating point values. A 512 bit vector is also received as asecond input operand 402_C. The 512 bit vector can be viewed as beingcomposed of two contiguous “chunks” of data each of which are 256 bitsin size. An immediate operand (not shown), indicates which 256 bit“chunk” of the second operand 402_C is to be overwritten with the firstinput operand 401_C.

A mask is then applied to the resulting data structure 403_C. Here, amasking layer 404_C receives an input mask vector (not shown) thatidentifies which 32 bit data values of the resulting data structure403_C are to be written to the destination 406_C. Both the location ofthe mask vector in mask register space, and, the location of thedestination in vector register space are identified in the instructionformat. The source of the first and second input operands 401_C, 402_Care also identified in the instruction format. In an embodiment, thefirst input operand 401_C may be sourced from vector register space or amemory location, and, the second input operand 402_C is sourced fromvector register space. The immediate operand is also included in theinstruction format. In an embodiment, the vector register space wherethe destination is stored is different than the vector register spacefrom where the input operands are sourced.

FIG. 4d shows the logic operation of a VINSERTF64X4 instruction. Asobserved in FIG. 4d , a 256 bit structure 401_D is received as a firstinput operand. The 256 bit structure contains four 64 bit doubleprecision floating point values. A 512 bit vector is also received as asecond input operand 402_D. The 512 bit vector can be viewed as beingcomposed of two contiguous “chunks” of data each of which are 256 bitsin size. An immediate operand (not shown), indicates which 256 bit“chunk” of the second operand 402_D is to be overwritten with the firstinput operand 401_D.

A mask is then applied to the resulting data structure 403_D. Here, amasking layer 404_D receives an input mask vector (not shown) thatidentifies which 64 bit data values of the resulting data structure403_D are to be written to the destination 406_D. Both the location ofthe mask vector in mask register space, and, the location of thedestination in vector register space are identified in the instructionformat. The source of the first and second input operands 401_D, 402_Dare also identified in the instruction format. In an embodiment, thefirst input operand 401_D may be sourced from vector register space or amemory location, and, the second input operand 402_D is sourced fromvector register space. The immediate operand is also included in theinstruction format. In an embodiment, the vector register space wherethe destination is stored is different than the vector register spacefrom where the input operands are sourced.

FIGS. 4e through 4h show four new VEXTRACT instructions. Specifically,FIG. 4e shows a VEXTRACT32X4 instruction, FIG. 4f shows a VEXTRACT64X2instruction, FIG. 4g shows a VEXTRACT32X8 instruction and FIG. 4h showsa VEXTRACT64X4 instruction.

FIG. 4e shows the logical operation of a VEXTRACT32X4 instruction. Asobserved in FIG. 4e , the VEXTRACT32X4 instruction accepts a 512 bitinput operand 401_E. The 512 bit input operand 401_E can be viewed asbeing composed of four contiguous 128 bit “chunks” of data, where, eachchunk contains four single precision (32 bit) floating point datavalues. According to the logical operation of the VEXTRACT32X4instruction, one of these 128 bit chunks is “selected”, a masking layer402_E is applied to the selected chunk, and the resulting data structureis written to a destination 403_E.

In an embodiment, an immediate operand (not shown) specifies which ofthe four 128 bit chunks is to be selected, the input operand 401_E isprovided from a vector register and the destination 401_E can be ineither vector register space or a memory location. The instructionformat identifies any applicable source/destination vector registerand/or memory locations. In an embodiment, the destination is stored indifferent vector register space than the vector register space fromwhere the input vector is sourced from. During operation of theinstruction, a mask vector is read from mask register space and appliedto the masking layer 402_E. The location of the mask vector in maskregister space is also provided in the instruction format. Thegranularity of the masking is 32 bits. That is, the masking vectorindividually specifies which of the four 32 bit values in the selecteddata chunk are to be written to the destination.

FIG. 4f shows the logical operation of a VEXTRACT64X2 instruction. Asobserved in FIG. 4f , the VEXTRACT64X2 instruction accepts a 512 bitinput operand 401_F. The 512 bit input operand 401_F can be viewed asbeing composed of four contiguous 128 bit “chunks” of data, where, eachchunk contains two double precision (64 bit) floating point data values.According to the logical operation of the VEXTRACT64X2 instruction, oneof these 128 bit chunks is “selected”, a masking layer 402_F is appliedto the selected chunk, and the resulting data structure is written to adestination 403_F.

In an embodiment, an immediate operand (not shown) specifies which ofthe four 128 bit chunks is to be selected, the input operand 401_F isprovided from a vector register and the destination 403_F can be ineither vector register space or a memory location. The instructionformat identifies any applicable source/destination vector registerand/or memory locations. In an embodiment, the destination is stored indifferent vector register space than the vector register space fromwhere the input vector is sourced from. During operation of theinstruction, a mask vector is read from mask register space and appliedto the masking layer 402_F. The location of the mask vector in maskregister space is also provided in the instruction format. Thegranularity of the masking is 64 bits. That is, the masking vectorindividually specifies which of the two 64 bit values in the selecteddata chunk are to be written to the destination.

FIG. 4g shows the logical operation of a VEXTRACT32X8 instruction. Asobserved in FIG. 4g , the VEXTRACT32X8 instruction accepts a 512 bitinput operand 401_G. The 512 bit input operand 401_G can be viewed asbeing composed of two contiguous 256 bit “chunks” of data, where, eachchunk contains eight single precision (32 bit) floating point datavalues. According to the logical operation of the VEXTRACT32X8instruction, one of these 256 bit chunks is “selected”, a masking layer402_G is applied to the selected chunk, and the resulting data structureis written to a destination 403_G.

In an embodiment, an immediate operand (not shown) specifies which ofthe two 256 bit chunks is to be selected, the input operand 401_G isprovided from a vector register and the destination 403_G can be ineither vector register space or a memory location. The instructionformat identifies any applicable source/destination vector registerand/or memory locations. In an embodiment, the destination is stored indifferent vector register space than the vector register space fromwhere the input vector is sourced from. During operation of theinstruction, a mask vector is read from mask register space and appliedto the masking layer 402_G. The location of the mask vector in maskregister space is also provided in the instruction format. Thegranularity of the masking is 32 bits. That is, the masking vectorindividually specifies which of the eight 32 bit values in the selecteddata chunk are to be written to the destination.

FIG. 4h shows the logical operation of a VEXTRACT64X4 instruction. Asobserved in FIG. 4h , the VEXTRACT64X4 instruction accepts a 512 bitinput operand 401_H. The 512 bit input operand 401_H can be viewed asbeing composed of two contiguous 256 bit “chunks” of data, where, eachchunk contains four double precision (64 bit) floating point datavalues. According to the logical operation of the VEXTRACT64X4instruction, one of these 256 bit chunks is “selected”, a masking layer402_H is applied to the selected chunk, and the resulting data structureis written to a destination 403_H.

In an embodiment, an immediate operand (not shown) specifies which ofthe two 256 bit chunks is to be selected, the input operand 401_H isprovided from a vector register and the destination 403_H can be ineither vector register space or a memory location. The instructionformat identifies any applicable source/destination vector registerand/or memory locations. In an embodiment, the destination is stored indifferent vector register space than the vector register space fromwhere the input vector is sourced from. During operation of theinstruction, a mask vector is read from mask register space and appliedto the masking layer 402_H. The location of the mask vector in maskregister space is also provided in the instruction format. Thegranularity of the masking is 64 bits. That is, the masking vectorindividually specifies which of the four 64 bit values in the selecteddata chunk are to be written to the destination.

FIGS. 4i through 4p present new VPERMUTE instructions. These includeVPERMW, VPERMD, VPERMQ, VPERMILPS, VPERMILPD,

FIGS. 4i shows the logical operation of a VPERMW instruction. The VPERMWinstruction accepts a 512 bit input vector as a first input operand401_I. The 512 bit input vector is viewed as having thirty two 16 bitdata values (words). A masking layer 402_I likewise has the granularityto mask at 16 bit granularity. That is, the destination/resultant vector403_I is viewed as having thirty two 16 bit values, and, the maskinglayer 402_I has the capability to provide individual masking for eachelement in the resultant vector 403_I.

According to the logical operation of the VPERMW instruction, eachelement in the resultant vector 403_I is filled with any one of thethirty two elements in the input vector 401_I. This capability is shownfor the rightmost element 403_I_1 of the resultant 403_I. Here, asobserved in FIG. 4i , masking layer element 402_I_1 can be provided withany one of the thirty two elements in the input vector 401_I. As such,if resultant element 403_I_1 is not “masked out” at masking element402_I_1, resultant element 403_I_1 can be “filled” with any one of thethirty two 16 bit elements in the input vector 401_I.

Although not explicitly shown in FIG. 4i , this same capability/functionis applied for each of the remaining thirty one elements in theresultant vector 403_I. That is, any element in the resultant vector403_I, if not masked out by a dedicated masking element in the maskinglayer 402_I for that particular element in the resultant, can be filledwith any one of the 16 bit values in the input vector 401_I. This means,for instance, that two or more elements in the resultant 403_I can befilled with the same element from the input vector 401_I.

The source for the input vector 401_I and the destination for theresultant vector 403_I are specified in the VPERMW instruction format.In an embodiment, the input vector 401_I is provided from a location invector register space or memory and the resultant is written into alocation in different vector register space. The masking layer 402_I isalso provided with a masking vector from mask register space thatspecifies which elements in the resultant 403_I are to be masked out(and which elements in the resultant 403_I are not to be masked out).

A second input vector (not shown), referred to as an “index” vector, isalso provided that articulates, for each element in the output vector,what specific input element is to be used to fill that element in theoutput vector if it is not masked out. For example, in an embodiment,the index vector is a 32 element vector having at least five bits ateach element. Each element in the index vector corresponds to a uniqueelement in the resultant. The five bits are used to specify whichelement in the first input vector 401_I is to be used to fill theparticular resultant element (if it is not masked out).

In an embodiment a second version of the VPERMW instruction is alsosupported that accepts a third input vector (not shown) containingthirty two additional 16 bit values that may be used to fill any outputvector element location. Essentially, the third input vector doubles thenumber of available 16 bit input values that can be used to fill anyoutput element location. For this version of the VPERMW instruction, theindex vector mentioned just above uses at least 6 bits for each outputlocation rather than 5 bits. Here, the extra bit is used to identifywhether the first (401_I) or third (not shown) input vectors is to beused to source the particular output vector 403_I element. A firstvariant of this version equates the destination register space with theregister space that supplies the index vector. That is, the result iswritten over the index vector in vector register space. A second variantof this version overwrites the third input vector in vector registerspace with the resultant. In either variant the destination location isnot separately identified in the instruction format apart from the indexvector location (first variant) or third input vector (second variant).

FIGS. 4j shows the logical operation of a VPERMD instruction. The VPERMDinstruction accepts a 512 bit input vector as a first input operand401_J. The 512 bit input vector is viewed as having sixteen 32 bit datavalues. The 32 bit values may be double words or single precision 32 bitvalues. A masking layer 402_J likewise has the granularity to mask at 32bit granularity. That is, the destination/resultant vector 403_J isviewed as having sixteen 32 bit values, and, the masking layer 402_J hasthe capability to provide individual masking for each element in theresultant vector 403_J.

According to the logical operation of the VPERMD instruction, eachelement in the resultant vector 403_J is filled with any one of thesixteen elements in the input vector 401_J. This capability is shown forthe rightmost element 403_J_1 of the resultant 403_J. Here, as observedin FIG. 4j , masking layer element 402_J_1 can be provided with any oneof the sixteen elements in the input vector 401_J. As such, if resultantelement 403_J_1 is not “masked out” at masking element 402_J_1,resultant element 403_J_1 can be “filled” with any one of the sixteen 32bit elements in the input vector 401_J.

Although not explicitly shown in FIG. 4j , this same capability/functionis applied for each of the remaining fifteen elements in the resultantvector 403_J. That is, any element in the resultant vector 403_J, if notmasked out by a dedicated masking element in the masking layer 402_J forthat particular element in the resultant, can be filled with any one ofthe 32 bit values in the input vector 401_J. This means, for instance,that two or more elements in the resultant 403_J can be filled with thesame element from the input vector 401_J.

The source for the input vector 401_J and the destination for theresultant vector 403_J are specified in the VPERMD instruction format.In an embodiment, the input vector 401_J is provided from a location invector register space or memory and the resultant is written into alocation in different vector register space. The masking layer 402_J isalso provided with a masking vector from mask register space thatspecifies which elements in the resultant 403_J are to be masked out(and which elements in the resultant 403_J are not to be masked out).

A second input vector (not shown), referred to as an “index” vector, isalso provided that articulates, for each element in the output vector,what specific input element is to be used to fill that element in theoutput vector if it is not masked out. For example, in an embodiment,the index vector is a 16 element vector having at least five bits ateach element. Each element in the index vector corresponds to a uniqueelement in the resultant. The five bits are used to specify whichelement in the first input vector 401_J is to be used to fill theparticular resultant element (if it is not masked out).

In an embodiment a second version of the VPERMW instruction is alsosupported that accepts a third input vector (not shown) containingsixteen additional 32 bit values that may be used to fill any outputvector element location. Essentially, the third input vector doubles thenumber of available 32 bit input values that can be used to fill anyoutput element location. For this version of the VPERMW instruction, theindex vector mentioned just above uses at least 6 bits for each outputlocation rather than 5 bits. Here, the extra bit is used to identifywhether the first (401_J) or third (not shown) input vectors is to beused to source the particular output vector 403_J element. A firstvariant of this version equates the destination register space with theregister space that supplies the index vector. That is, the result iswritten over the index vector in vector register space. A second variantof this version overwrites the third input vector in vector registerspace with the resultant. In either of these variants the destinationlocation is not separately identified in the instruction format apartfrom the index vector location (first variant) or third input vector(second variant).

FIGS. 4k shows the logical operation of a VPERMQ instruction. The VPERMQinstruction accepts a first 512 bit input vector as a first inputoperand 401_K and accepts a second 512 bit input vector as a secondinput operand (not shown). Both of the 512 bit input vectors are viewedas having eight 64 bit data values. The 64 bit values may be quad wordsor double precision floating point values. A masking layer 402_Klikewise has the granularity to mask at 64 bit granularity. That is, thedestination/resultant vector 403_K is viewed as having eight 64 bitvalues, and, the masking layer 402_K has the capability to provideindividual masking for each element in the resultant vector 403_K.

According to the logical operation of the VPERMQ instruction, eachelement in the resultant vector 403_K is filled with any one of thesixteen elements in the combination of input vectors (401_K and the notshown input vector). This capability is shown for the rightmost element403_K_1 of the resultant 403_K. Here, as observed in FIG. 4k , maskinglayer element 402_K_1 can be provided with any one of the eight elementsin input vector 401_K, or, any one of the eight elements in the secondinput vector (not shown). As such, if resultant element 403_K_1 is not“masked out” at masking element 402_K_1, resultant element 403_K_1 canbe “filled” with any one of the sixteen 64 bit elements from the pair ofinput vectors.

Although not explicitly shown in FIG. 4k , this same capability/functionis applied for each of the remaining eight elements in the resultantvector 403_K. That is, any element in the resultant vector 403_K, if notmasked out by a dedicated masking element in the masking layer 402_K forthat particular element in the resultant, can be filled with any one ofthe 64 bit values in either of the input vectors. This means, forinstance, that two or more elements in the resultant 403_K can be filledwith the same element from the input vector 401_K.

The source for both of the input vectors are specified in the VPERMQinstruction format. In an embodiment, input vector 401_K is providedfrom a location in vector register space or memory and the second inputvector is provided from its own respective location in vector registerspace. The masking layer 402_K is also provided with a masking vectorfrom mask register space that specifies which elements in the resultant403_K are to be masked out (and which elements in the resultant 403_Kare not to be masked out).

Another input vector (not shown), referred to as an “index” vector, isalso provided that articulates, for each element in the output vector,what specific input element is to be used to fill that element in theoutput vector if it is not masked out. For example, in an embodiment,the index vector is an eight element vector having at least six bits ateach element. Each element in the index vector corresponds to a uniqueelement in the resultant. Five of the aforementioned six bits are usedto specify which element in the first input vector 401_K or second inputvector is to be used to fill the particular resultant element (if it isnot masked out). The sixth bit is used to identify whether the first(401_K) or second (not shown) input vectors is to be used to source theparticular output vector 403_K element.

A first variant of the VPERMQ equates the destination register spacewith the register space that supplies the index vector. That is, theresult is written over the index vector in vector register space. Asecond variant overwrites the second input vector in vector registerspace with the resultant. In either variant the destination location isnot separately identified in the instruction format apart from the indexvector location (first variant) or second input vector (second variant).

FIG. 4l shows a new VPERMILPS instruction. As observed in FIG. 41, thenew VPERMILPS instruction accepts an input operand that corresponds to a512 bit input vector 401_L having sixteen 32 bit (single precision)floating point values. The result is also a 512 bit vector havingsixteen 32 bit single precision floating point values as its elements403_L. A masking layer 402_L likewise has the granularity to mask at 32bit granularity. That is, the destination/resultant vector 403_L isviewed as having sixteen 32 bit values, and, the masking layer 402_L hasthe capability to provide individual masking for each element in theresultant vector 403_L.

A second input vector (not shown), referred to as an “index” vector,uniquely specifies which of four elements in the input vector 401_L can“fill” a particular element in the result 403 if it is not masked by themasking layer 402_L. For example, each of the four elements 403_L_1through 403_L_4 in the least significant 128 bits of the result 403_Lcan only be filled with any of the four elements 401_L_1 through 403_L_4in the least significant 128 bits of input vector 401_L. The source foreach element in the result is independent of the source for anotherelement in the result. Thus two different elements in the output vectorcan be filled with a same input vector element.

FIG. 4l shows the available input sources for output element 403_L_1being provided to the masking layer 402_L. Again, these same inputsources are also available for each of output elements 403_L_2 through403_L_4. A similar arrangement is orchestrated for each next group of128 bits. That is, assuming no masking, elements from group 403_L_Q2must be sourced from elements in group 401_L_Q2, elements from group403_L_Q3 must be sourced from elements in group 401_L_Q3, and, elementsfrom group 403_L_Q4 must be sourced from elements in group 401_L_Q4.

In an embodiment, different versions of the new VPERMILPS instructionare supported in the instruction set of a same processor. A firstversion stores input vector 401_L in a first vector register spacelocation, stores the index vector in a second vector register spacelocation or a memory location and stores the result in its own dedicatedvector register space location (i.e., neither input vector 401_L nor theindex vector are overwritten). A second version stores the input vector401_L in a first vector register space location or a memory location,specifies the index vector in the instruction as an immediate operandand stores the result in its own dedicated vector register spacelocation (i.e., the input vector 401_L is not overwritten).

The masking layer 402_L receives a mask vector from mask register space.The location of the mask vector in the mask register space is specifiedin the instruction. In versions where the index vector is used tospecify the selection pattern between the input vector elements and theoutput vector elements, the index vector has sixteen elements (oneelement for each element in the output vector), and, two bits at eachelement to select one of the four input vector elements that areavailable to fill the respective output vector element. In versionswhere the immediate operand is utilized, the immediate operand has eightelements with two bits per element. Here, the same selection pattern isused for the lower half and upper half of the output vector.

FIG. 4m shows a new VPERMILPD instruction. As observed in FIG. 4m , thenew VPERMILPD instruction accepts an input operand 401_M thatcorresponds to a 512 bit input vector having eight 64 bit (doubleprecision) floating point values. The result is also a 512 bit vector403_M having eight 64 bit double precision floating point values as itselements. A masking layer 402_M likewise has the granularity to mask at64 bit granularity. That is, the destination/resultant vector 403_M isviewed as having eight 64 bit values, and, the masking layer 402_M hasthe capability to provide individual masking for each element in theresultant vector 403_M.

A second input vector (not shown), referred to as an “index” vector,uniquely specifies which of two elements in the input vector 401_M can“fill” a particular element in the result 403_M if it is not masked bythe masking layer 402_M. For example, both of elements 403_M_1 and403_M_2 in the least significant 128 bits of the result 403_M can onlybe filled with either of elements 401_M_1 and 401_M_2 in the leastsignificant 128 bits of input vector 401_K. The source for each elementin the result is independent of the source for another element in theresult. Thus two different elements in the output vector can be filledwith a same input vector element.

FIG. 4m shows the available input sources for output element 403_M_1 and403_M_2 being provided to the masking layer 402_M. A similar arrangementis orchestrated for the remaining groups of 128 bits in the outputvector 403_M. That is, assuming no masking, elements from group 403_M_Q2must be sourced from elements in group 401_M_Q2, elements from group403_M_Q3 must be sourced from elements in group 401_M_Q3, and, elementsfrom group 403_M_Q4 must be sourced from elements in group 401_M_Q4.

In an embodiment, different versions of the new VPERMILPD instructionare supported in the instruction set of a same processor. A firstversion stores input vector 401_M in a first vector register spacelocation, stores the index vector in a second vector register spacelocation or a memory location and stores the result in its own dedicatedvector register space location (i.e., neither input vector 401_M nor theindex vector are overwritten). A second version stores the input vector401_M in a first vector register space location or a memory location,specifies the index vector in the instruction as an immediate operandand stores the result in its own dedicated vector register spacelocation (i.e., the input vector 401_M is not overwritten).

The masking layer 402_M receives a mask vector from mask register space.The location of the mask vector in the mask register space is specifiedin the instruction. In versions where the index vector is used tospecify the selection pattern between the input vector elements and theoutput vector elements, the index vector has eight elements (one elementfor each element in the output vector), and, one bit at each element toselect one of two input vector elements that are available to fill therespective output vector element. In versions where the immediateoperand is utilized, the immediate operand has eight elements with onebit per element.

FIG. 4n shows a VPERM64X1 instruction. As observed in FIG. 4n , theVPERM64X1 instruction accepts an input operand that corresponds to a 512bit input vector 401_N having eight 64 bit (double precision) floatingpoint values. The result is also a 512 bit vector 403_N having eight 64bit double precision floating point values as its elements. A maskinglayer 402_N likewise has the granularity to mask at 64 bit granularity.That is, the destination/resultant vector 403_N is viewed as havingeight 64 bit values, and, the masking layer 402_N has the capability toprovide individual masking for each element in the resultant vector403_N.

A second input vector (not shown), referred to as an “index” vector,uniquely specifies which of eight elements in the input vector 401_N can“fill” a particular element in the result 403_N if it is not masked bythe masking layer 402_N. That is, any element in the input vector 401_Ncan be used to fill any element in the output vector 403_N. The sourcefor each element in the result is independent of the source for anotherelement in the result. Thus two different elements in the output vectorcan be filled with a same input vector element.

FIG. 4n shows the available input sources for output element 403_N_1being provided to the masking layer 402_N. A similar arrangement isorchestrated for each element in the output vector 403_N. As describedin more detail below, in an embodiment where the immediate operand isused as the index vector, the source selections are more restricted.

In an embodiment, different versions of the new VPERM64X1 instructionare supported in the instruction set of a same processor. A firstversion stores input vector 401_N in a first vector register spacelocation or a memory location, stores the index vector in a secondvector register space location and stores the result in its owndedicated vector register space location (i.e., neither input vector401_N nor the index vector are overwritten). A second version stores theinput vector 401_N in a first vector register space location or a memorylocation, specifies the index vector in the instruction as an immediateoperand and stores the result in its own dedicated vector register spacelocation (i.e., the input vector 401_N is not overwritten).

The masking layer 402_N receives a mask vector from mask register space.The location of the mask vector in the mask register space is specifiedin the instruction. In versions where the index vector is used tospecify the selection pattern between the input vector elements and theoutput vector elements, the index vector has eight elements (one elementfor each element in the output vector), and, three bits at each elementto select one of eight input vector elements that are available to fillthe respective output vector element. In versions where the immediateoperand is utilized, the immediate operand has four elements with twobits per element. Here, each output element does not have all eightinput elements available to it as a source. Rather, any element in theleast significant 256 bits of the output vector 403_N must be sourced byan element in the least significant 256 bits of the input vector 403_N.The same selection pattern of sources for the least significant 256 bitsof the input/output vectors is used for the most significant bits of theinput/output vectors.

FIG. O shows the logical operation of a VPERM64X2 instruction. Accordingto the operation of the VPERM64X2 instruction, a 512 bit input vector401_O is received. The 512 bit input vector 401_O is viewed as havingeight 64 bit double precision floating point or integer values. Theresult is also a 512 bit vector 403_O having eight 64 bit doubleprecision floating point or integer values as its elements. A maskinglayer 402_O likewise has the granularity to mask at 64 bit granularity.That is, the destination/resultant vector 403_O is viewed as havingeight 64 bit values, and, the masking layer 402_O has the capability toprovide individual masking for each element in the resultant vector403_O.

A second input vector (not shown), referred to as an “index” vector,uniquely specifies which neighboring pair of elements in the inputvector 401_O can “fill” a particular pair of neighboring elements in theresult 403_O if the pair of elements is not masked by the masking layer402_O. That is, any one of four pairs of neighboring elements in theinput vector 401_O can be used to fill any pair of elements in theoutput vector 403_O. The source for a first pair of elements in theresult is independent of the source for another pair of elements in theresult. Thus, two different pairs of elements in the output vector canbe filled with a same pair of input vector elements.

FIG. 4O shows the available input sources for output element pair403_O_1 being provided to the masking layer 402_O. A similar arrangementis orchestrated for the other pair elements 403_O_2, 403_O_3 and403_O_4.

In an embodiment, different versions of the VPERM64X2 instruction aresupported in the instruction set of a same processor. A first versionstores input vector 401_O in a first vector register space location or amemory location, stores the index vector in a second vector registerspace location and stores the result in its own dedicated vectorregister space location (i.e., neither input vector 401_O nor the indexvector are overwritten). A second version stores the input vector 401_Oin a first vector register space location or a memory location,specifies the index vector in the instruction as an immediate operandand stores the result in its own dedicated vector register spacelocation (i.e., the input vector 401_O is not overwritten).

The masking layer 402_O receives a mask vector from mask register space.The location of the mask vector in the mask register space is specifiedin the instruction. In versions where the index vector is used tospecify the selection pattern between the input vector elements and theoutput vector elements, the index vector has four elements (one elementfor each pair of elements in the output vector), and, two bits at eachelement to select one of four pairs of input vector elements that areavailable to fill the respective pair of output vector elements. Inversions where the immediate operand is utilized, the immediate operandhas the same structure as the index vector.

FIG. 4P shows the logical operation of a VPERM32X4 instruction.According to the operation of the VPERM32X4 instruction, a 512 bit inputvector 401_P is received. The 512 bit input vector 401_P is viewed ashaving sixteen 32 bit single precision floating point or integer values.The result is also a 512 bit vector 403_P having sixteen 32 bit singleprecision floating point or integer values as its elements. A maskinglayer 402_P likewise has the granularity to mask at 32 bit granularity.That is, the destination/resultant vector 403_P is viewed as havingeight 64 bit values, and, the masking layer 402_P has the capability toprovide individual masking for each element in the resultant vector403_P.

A second input vector (not shown), referred to as an “index” vector,uniquely specifies which group of four 32 bit elements in the inputvector 401_P can “fill” a particular group of neighboring 32 bitelements in the result 403_P if the group of elements is not masked bythe masking layer 402_P. That is, any one of four groups of fourneighboring elements in the input vector 401_P can be used to fillcertain groups of four elements in the output vector 403_P. The sourcefor a first group of elements in the result is independent of the sourcefor another group of four elements in the result. Thus, two differentgroups of four elements in the output vector can be filled with a samegroup of four input vector elements.

FIG. 4P shows the available input sources for output element group403_P_1 being provided to the masking layer 402_P. A similar arrangementis orchestrated for the other element groups 403_P_2, 403_P_3 and403_P_4.

In an embodiment, different versions of the VPERM32X4 instruction aresupported in the instruction set of a same processor. A first versionstores input vector 401_P in a first vector register space location or amemory location, stores the index vector in a second vector registerspace location and stores the result in its own dedicated vectorregister space location (i.e., neither input vector 401_P nor the indexvector are overwritten). A second version stores the input vector 401_Pin a first vector register space location or a memory location,specifies the index vector in the instruction as an immediate operandand stores the result in its own dedicated vector register spacelocation (i.e., the input vector 401_P is not overwritten).

The masking layer 402_P receives a mask vector from mask register space.The location of the mask vector in the mask register space is specifiedin the instruction. In versions where the index vector is used tospecify the selection pattern between the input vector elements and theoutput vector elements, the index vector has four elements (one elementfor each group of four elements in the output vector), and, two bits ateach element to select one of four groups of four input vector elementsthat are available to fill the respective group of four output vectorelements. In versions where the immediate operand is utilized, theimmediate operand has the same structure as the index vector.

Depending on implementation, the data fetch stage of a pipeline thatsupports these instructions may be coupled to memory to fetch an operandfrom memory, and/or, be coupled to vector register space to fetch/storean operand/result from/to vector register space.

Moreover, for those instructions that were described as only supportingfloating point data values, conceivably, these same instructions may beextended to process integer as well as floating point data values. Here,register space 102 of FIG. 1 may include a first portion dedicated tostoring integer values and another portion dedicated to storing floatingpoint values. Without the extension to integer values, the data fetchand write back stages of the pipeline are coupled to floating pointregister space and need not be coupled to integer register space withrespect to the manner in which these instructions are processed. Bycontrast, the data fetch and write back stages can be coupled to either(depending on the decoding of the instruction), if these instructionsare designed to support both data types.

FIG. 5a shows a logic design for an execution that can implement anycombination (including all) of the instructions discussed above in FIGS.4a through 4p . In other embodiments, different respective executionunits are used to execute the vector extract, vector insert and vectorpermute instructions discussed just above. In still further possibleembodiments, a single execution unit may execute the instruction setfrom two of these instruction families.

Referring to FIG. 5a , a first register 501 holds the first inputoperand discussed above. Notably the size of the first register 501should be large enough to hold the largest data structure it is expectedto be able to replicate. The first register 501 may be located at theback end of a data fetch stage in a pipeline. Alternatively or incombination, register 501 may be considered to be a register withinvector register space 107 where the first input operand is stored.Alternatively, the first register may be located in the “front end” ofan execution unit. The first register 501 is coupled to vector elementrouting logic circuitry 502. The vector element routing logic circuitry502 is designed to direct the individual elements of the input operandin the first register 501 to the appropriate element location of themasking layer logic circuitry 504 consistent with the information andthe index vector (or immediate operand) and the overall instructionbeing executed. For those implementations that are micro-coded, the term“logic circuitry” and the like for the vector element routing logiccircuitry 502 would include the micro-code and the logic that acts inresponse to the micro-code. Register 507 holds the index vector (orimmediate operand) and is coupled to the vector element routing logiccircuitry 502 to control the “routing” of the first operand's vectorelements.

Outputs 503 of the vector element routing logic circuitry 502 arecoupled to masking logic circuitry 504. In an embodiment, the number ofindividual outputs in outputs 503 corresponds to the maximum possiblesize of the resultant vector (e.g., 512 bits). The masking layer logiccircuitry 502 is architected to support the specific vector elementgranularities of the instructions supported by the execution unit. Forexample, if the execution unit supports both 16 bit, 32 bit, and 64 bitresultant element granularities, the masking layer logic circuitry 502is designed to support masking at each of these granularities.

As discussed at length above, masking layer logic circuitry 504 receivesa masking pattern from register 505 to apply a mask to the outputs 503from the vector element routing to create the resultant data structurein register 506. Register 505 may correspond to a register in maskregister space, a register at the output of a data fetch stage in apipeline, a register at the front end of the execution unit, or, aregister (e.g., at the output of an instruction decode stage of apipeline) that holds an immediate value in an instruction (when the maskpattern is embedded in the instruction).

Depending on implementation, register 506 may correspond to a registerwithin vector register space 107, or register 506 may be a register thatat the output of the execution unit.

Input register 510 stores an additional input operand for thoseinstructions discussed above that accept a second input vector whoseelements can be selected for inclusion into the resultant (e.g., VPERMW,VPERMD and VPERMQ). Input register 510, or another register, may also beused to store the second operand for the VINSERT instructions discussedabove. As such the register is shown feeding the destination 506.Register 510 may be in vector register space, at the output of a datafetch stage of an instruction execution pipeline, or, may be at theinput of the execution unit.

In a further embodiment, the execution unit logic circuit is designed tosupport not only any/all of the instructions of FIGS. 4a through 4p ,but also, any/all of the prior art instructions of FIGS. 3a through 3e .In this case, because the prior art instructions of FIGS. 3a through 3edo not support masking, there exist a bypass path that circumvents themasking layer logic circuitry 504 when these instructions are beingexecuted. Alternatively, the bypass may be effected by automaticallyfeeding the masking later with information that corresponds to eachelement in the resultant not being masked.

Although the descriptions of the above instructions included specificbit widths for the data values, the vector elements to beextracted/inserted/permuted and the size of the result, those ofordinary skill will recognize that the concepts described therein couldbe extended to different respective widths.

FIG. 5b shows a methodology that can be performed by the logic circuitryof FIG. 5a . The input vector to be extracted/inserted/permuted isplaced in a first register 510, and, at least if masking applies, a maskpattern is placed in a second register. Specific element(s) of the inputvector are then selected for inclusion in the resultant consistent withthe instruction 511. If masking applies the mask pattern is applied 512to the result of operation 511 to create the resultant. The resultant isthen written to a destination 513. If masking does not apply theresultant is the result of operation 511.

Exemplary Instruction Formats

Embodiments of the instruction(s) described herein may be embodied indifferent formats. Additionally, exemplary systems, architectures, andpipelines are detailed below. Embodiments of the instruction(s) may beexecuted on such systems, architectures, and pipelines, but are notlimited to those detailed.

Generic Vector Friendly Instruction Format

A vector friendly instruction format is an instruction format that issuited for vector instructions (e.g., there are certain fields specificto vector operations). While embodiments are described in which bothvector and scalar operations are supported through the vector friendlyinstruction format, alternative embodiments use only vector operationsthe vector friendly instruction format.

FIGS. 6A-6B are block diagrams illustrating a generic vector friendlyinstruction format and instruction templates thereof according toembodiments of the invention. FIG. 6A is a block diagram illustrating ageneric vector friendly instruction format and class A instructiontemplates thereof according to embodiments of the invention; while FIG.6B is a block diagram illustrating the generic vector friendlyinstruction format and class B instruction templates thereof accordingto embodiments of the invention. Specifically, a generic vector friendlyinstruction format 600 for which are defined class A and class Binstruction templates, both of which include no memory access 605instruction templates and memory access 620 instruction templates. Theterm generic in the context of the vector friendly instruction formatrefers to the instruction format not being tied to any specificinstruction set.

While embodiments of the invention will be described in which the vectorfriendly instruction format supports the following: a 64 byte vectoroperand length (or size) with 32 bit (4 byte) or 64 bit (8 byte) dataelement widths (or sizes) (and thus, a 64 byte vector consists of either16 doubleword-size elements or alternatively, 8 quadword-size elements);a 64 byte vector operand length (or size) with 16 bit (2 byte) or 8 bit(1 byte) data element widths (or sizes); a 32 byte vector operand length(or size) with 32 bit (4 byte), 64 bit (8 byte), 16 bit (2 byte), or 8bit (1 byte) data element widths (or sizes); and a 16 byte vectoroperand length (or size) with 32 bit (4 byte), 64 bit (8 byte), 16 bit(2 byte), or 8 bit (1 byte) data element widths (or sizes); alternativeembodiments may support more, less and/or different vector operand sizes(e.g., 256 byte vector operands) with more, less, or different dataelement widths (e.g., 128 bit (16 byte) data element widths).

The class A instruction templates in FIG. 6A include: 1) within the nomemory access 605 instruction templates there is shown a no memoryaccess, full round control type operation 610 instruction template and ano memory access, data transform type operation 615 instructiontemplate; and 2) within the memory access 620 instruction templatesthere is shown a memory access, temporal 625 instruction template and amemory access, non-temporal 630 instruction template. The class Binstruction templates in FIG. 6B include: 1) within the no memory access605 instruction templates there is shown a no memory access, write maskcontrol, partial round control type operation 612 instruction templateand a no memory access, write mask control, vsize type operation 617instruction template; and 2) within the memory access 620 instructiontemplates there is shown a memory access, write mask control 627instruction template.

The generic vector friendly instruction format 600 includes thefollowing fields listed below in the order illustrated in FIGS. 6A-6B.In conjunction with the discussions above, in an embodiment, referringto the format details provided below in FIGS. 6A-B and 7, either a nonmemory access instruction type 605 or a memory access instruction type620 may be utilized. Addresses for the read mask(s), input vectoroperand(s) and destination may be identified in register address field644 described below. In a further embodiment, the write mask isspecified in write mask field 670.

Format field 640—a specific value (an instruction format identifiervalue) in this field uniquely identifies the vector friendly instructionformat, and thus occurrences of instructions in the vector friendlyinstruction format in instruction streams. As such, this field isoptional in the sense that it is not needed for an instruction set thathas only the generic vector friendly instruction format.

Base operation field 642—its content distinguishes different baseoperations.

Register index field 644—its content, directly or through addressgeneration, specifies the locations of the source and destinationoperands, be they in registers or in memory. These include a sufficientnumber of bits to select N registers from a P×Q (e.g. 32×512, 16×128,32×1024, 64×1024) register file. While in one embodiment N may be up tothree sources and one destination register, alternative embodiments maysupport more or less sources and destination registers (e.g., maysupport up to two sources where one of these sources also acts as thedestination, may support up to three sources where one of these sourcesalso acts as the destination, may support up to two sources and onedestination).

Modifier field 646—its content distinguishes occurrences of instructionsin the generic vector instruction format that specify memory access fromthose that do not; that is, between no memory access 605 instructiontemplates and memory access 620 instruction templates. Memory accessoperations read and/or write to the memory hierarchy (in some casesspecifying the source and/or destination addresses using values inregisters), while non-memory access operations do not (e.g., the sourceand destinations are registers). While in one embodiment this field alsoselects between three different ways to perform memory addresscalculations, alternative embodiments may support more, less, ordifferent ways to perform memory address calculations.

Augmentation operation field 650—its content distinguishes which one ofa variety of different operations to be performed in addition to thebase operation. This field is context specific. In one embodiment of theinvention, this field is divided into a class field 668, an alpha field652, and a beta field 654. The augmentation operation field 650 allowscommon groups of operations to be performed in a single instructionrather than 2, 3, or 4 instructions.

Scale field 660—its content allows for the scaling of the index field'scontent for memory address generation (e.g., for address generation thatuses 2scale*index+base).

Displacement Field 662A—its content is used as part of memory addressgeneration (e.g., for address generation that uses2scale*index+base+displacement).

Displacement Factor Field 662B (note that the juxtaposition ofdisplacement field 662A directly over displacement factor field 662Bindicates one or the other is used)—its content is used as part ofaddress generation; it specifies a displacement factor that is to bescaled by the size of a memory access (N)—where N is the number of bytesin the memory access (e.g., for address generation that uses2scale*index+base+scaled displacement). Redundant low-order bits areignored and hence, the displacement factor field's content is multipliedby the memory operands total size (N) in order to generate the finaldisplacement to be used in calculating an effective address. The valueof N is determined by the processor hardware at runtime based on thefull opcode field 674 (described later herein) and the data manipulationfield 654C. The displacement field 662A and the displacement factorfield 662B are optional in the sense that they are not used for the nomemory access 605 instruction templates and/or different embodiments mayimplement only one or none of the two.

Data element width field 664—its content distinguishes which one of anumber of data element widths is to be used (in some embodiments for allinstructions; in other embodiments for only some of the instructions).This field is optional in the sense that it is not needed if only onedata element width is supported and/or data element widths are supportedusing some aspect of the opcodes.

Write mask field 670—its content controls, on a per data elementposition basis, whether that data element position in the destinationvector operand reflects the result of the base operation andaugmentation operation. Class A instruction templates supportmerging-writemasking, while class B instruction templates support bothmerging- and zeroing-writemasking. When merging, vector masks allow anyset of elements in the destination to be protected from updates duringthe execution of any operation (specified by the base operation and theaugmentation operation); in other one embodiment, preserving the oldvalue of each element of the destination where the corresponding maskbit has a 0. In contrast, when zeroing vector masks allow any set ofelements in the destination to be zeroed during the execution of anyoperation (specified by the base operation and the augmentationoperation); in one embodiment, an element of the destination is set to 0when the corresponding mask bit has a 0 value. A subset of thisfunctionality is the ability to control the vector length of theoperation being performed (that is, the span of elements being modified,from the first to the last one); however, it is not necessary that theelements that are modified be consecutive. Thus, the write mask field670 allows for partial vector operations, including loads, stores,arithmetic, logical, etc. While embodiments of the invention aredescribed in which the write mask field's 670 content selects one of anumber of write mask registers that contains the write mask to be used(and thus the write mask field's 670 content indirectly identifies thatmasking to be performed), alternative embodiments instead or additionalallow the mask write field's 670 content to directly specify the maskingto be performed.

Immediate field 672—its content allows for the specification of animmediate. This field is optional in the sense that is it not present inan implementation of the generic vector friendly format that does notsupport immediate and it is not present in instructions that do not usean immediate.

Class field 668—its content distinguishes between different classes ofinstructions. With reference to FIGS. 6A-B, the contents of this fieldselect between class A and class B instructions. In FIGS. 6A-B, roundedcorner squares are used to indicate a specific value is present in afield (e.g., class A 668A and class B 668B for the class field 668respectively in FIGS. 6A-B).

Instruction Templates of Class A

In the case of the non-memory access 605 instruction templates of classA, the alpha field 652 is interpreted as an RS field 652A, whose contentdistinguishes which one of the different augmentation operation typesare to be performed (e.g., round 652A.1 and data transform 652A.2 arerespectively specified for the no memory access, round type operation610 and the no memory access, data transform type operation 615instruction templates), while the beta field 654 distinguishes which ofthe operations of the specified type is to be performed. In the nomemory access 605 instruction templates, the scale field 660, thedisplacement field 662A, and the displacement scale filed 662B are notpresent.

No-Memory Access Instruction Templates—Full Round Control Type Operation

In the no memory access full round control type operation 610instruction template, the beta field 654 is interpreted as a roundcontrol field 654A, whose content(s) provide static rounding. While inthe described embodiments of the invention the round control field 654Aincludes a suppress all floating point exceptions (SAE) field 656 and around operation control field 658, alternative embodiments may supportmay encode both these concepts into the same field or only have one orthe other of these concepts/fields (e.g., may have only the roundoperation control field 658).

SAE field 656—its content distinguishes whether or not to disable theexception event reporting; when the SAE field's 656 content indicatessuppression is enabled, a given instruction does not report any kind offloating-point exception flag and does not raise any floating pointexception handler.

Round operation control field 658—its content distinguishes which one ofa group of rounding operations to perform (e.g., Round-up, Round-down,Round-towards-zero and Round-to-nearest). Thus, the round operationcontrol field 658 allows for the changing of the rounding mode on a perinstruction basis. In one embodiment of the invention where a processorincludes a control register for specifying rounding modes, the roundoperation control field's 650 content overrides that register value.

No Memory Access Instruction Templates—Data Transform Type Operation

In the no memory access data transform type operation 615 instructiontemplate, the beta field 654 is interpreted as a data transform field654B, whose content distinguishes which one of a number of datatransforms is to be performed (e.g., no data transform, swizzle,broadcast).

In the case of a memory access 620 instruction template of class A, thealpha field 652 is interpreted as an eviction hint field 652B, whosecontent distinguishes which one of the eviction hints is to be used (inFIG. 6A, temporal 652B.1 and non-temporal 652B.2 are respectivelyspecified for the memory access, temporal 625 instruction template andthe memory access, non-temporal 630 instruction template), while thebeta field 654 is interpreted as a data manipulation field 654C, whosecontent distinguishes which one of a number of data manipulationoperations (also known as primitives) is to be performed (e.g., nomanipulation; broadcast; up conversion of a source; and down conversionof a destination). The memory access 620 instruction templates includethe scale field 660, and optionally the displacement field 662A or thedisplacement scale field 662B.

Vector memory instructions perform vector loads from and vector storesto memory, with conversion support. As with regular vector instructions,vector memory instructions transfer data from/to memory in a dataelement-wise fashion, with the elements that are actually transferred isdictated by the contents of the vector mask that is selected as thewrite mask.

Memory Access Instruction Templates—Temporal

Temporal data is data likely to be reused soon enough to benefit fromcaching. This is, however, a hint, and different processors mayimplement it in different ways, including ignoring the hint entirely.

Memory Access Instruction Templates—Non-Temporal

Non-temporal data is data unlikely to be reused soon enough to benefitfrom caching in the 1st-level cache and should be given priority foreviction. This is, however, a hint, and different processors mayimplement it in different ways, including ignoring the hint entirely.

Instruction Templates of Class B

In the case of the instruction templates of class B, the alpha field 652is interpreted as a write mask control (Z) field 652C, whose contentdistinguishes whether the write masking controlled by the write maskfield 670 should be a merging or a zeroing.

In the case of the non-memory access 605 instruction templates of classB, part of the beta field 654 is interpreted as an RL field 657A, whosecontent distinguishes which one of the different augmentation operationtypes are to be performed (e.g., round 657A.1 and vector length (VSIZE)657A.2 are respectively specified for the no memory access, write maskcontrol, partial round control type operation 612 instruction templateand the no memory access, write mask control, VSIZE type operation 617instruction template), while the rest of the beta field 654distinguishes which of the operations of the specified type is to beperformed. In the no memory access 605 instruction templates, the scalefield 660, the displacement field 662A, and the displacement scale filed662B are not present.

In the no memory access, write mask control, partial round control typeoperation 610 instruction template, the rest of the beta field 654 isinterpreted as a round operation field 659A and exception eventreporting is disabled (a given instruction does not report any kind offloating-point exception flag and does not raise any floating pointexception handler).

Round operation control field 659A—just as round operation control field658, its content distinguishes which one of a group of roundingoperations to perform (e.g., Round-up, Round-down, Round-towards-zeroand Round-to-nearest). Thus, the round operation control field 659Aallows for the changing of the rounding mode on a per instruction basis.In one embodiment of the invention where a processor includes a controlregister for specifying rounding modes, the round operation controlfield's 650 content overrides that register value.

In the no memory access, write mask control, VSIZE type operation 617instruction template, the rest of the beta field 654 is interpreted as avector length field 659B, whose content distinguishes which one of anumber of data vector lengths is to be performed on (e.g., 128, 256, or512 byte).

In the case of a memory access 620 instruction template of class B, partof the beta field 654 is interpreted as a broadcast field 657B, whosecontent distinguishes whether or not the broadcast type datamanipulation operation is to be performed, while the rest of the betafield 654 is interpreted the vector length field 659B. The memory access620 instruction templates include the scale field 660, and optionallythe displacement field 662A or the displacement scale field 662B.

With regard to the generic vector friendly instruction format 600, afull opcode field 674 is shown including the format field 640, the baseoperation field 642, and the data element width field 664. While oneembodiment is shown where the full opcode field 674 includes all ofthese fields, the full opcode field 674 includes less than all of thesefields in embodiments that do not support all of them. The full opcodefield 674 provides the operation code (opcode).

The augmentation operation field 650, the data element width field 664,and the write mask field 670 allow these features to be specified on aper instruction basis in the generic vector friendly instruction format.

The combination of write mask field and data element width field createtyped instructions in that they allow the mask to be applied based ondifferent data element widths.

The various instruction templates found within class A and class B arebeneficial in different situations. In some embodiments of theinvention, different processors or different cores within a processormay support only class A, only class B, or both classes. For instance, ahigh performance general purpose out-of-order core intended forgeneral-purpose computing may support only class B, a core intendedprimarily for graphics and/or scientific (throughput) computing maysupport only class A, and a core intended for both may support both (ofcourse, a core that has some mix of templates and instructions from bothclasses but not all templates and instructions from both classes iswithin the purview of the invention). Also, a single processor mayinclude multiple cores, all of which support the same class or in whichdifferent cores support different class. For instance, in a processorwith separate graphics and general purpose cores, one of the graphicscores intended primarily for graphics and/or scientific computing maysupport only class A, while one or more of the general purpose cores maybe high performance general purpose cores with out of order executionand register renaming intended for general-purpose computing thatsupport only class B. Another processor that does not have a separategraphics core, may include one more general purpose in-order orout-of-order cores that support both class A and class B. Of course,features from one class may also be implement in the other class indifferent embodiments of the invention. Programs written in a high levellanguage would be put (e.g., just in time compiled or staticallycompiled) into an variety of different executable forms, including: 1) aform having only instructions of the class(es) supported by the targetprocessor for execution; or 2) a form having alternative routineswritten using different combinations of the instructions of all classesand having control flow code that selects the routines to execute basedon the instructions supported by the processor which is currentlyexecuting the code.

Exemplary Specific Vector Friendly Instruction Format

FIGS. 7A-7B are block diagrams illustrating an exemplary specific vectorfriendly instruction format according to embodiments of the invention.FIGS. 7A-7D show a specific vector friendly instruction format 700 thatis specific in the sense that it specifies the location, size,interpretation, and order of the fields, as well as values for some ofthose fields. The specific vector friendly instruction format 700 may beused to extend the x86 instruction set, and thus some of the fields aresimilar or the same as those used in the existing x86 instruction setand extension thereof (e.g., AVX). This format remains consistent withthe prefix encoding field, real opcode byte field, MOD R/M field, SIBfield, displacement field, and immediate fields of the existing x86instruction set with extensions. The fields from FIGS. 6A-6B into whichthe fields from FIGS. 7A-7D map are illustrated.

It should be understood that, although embodiments of the invention aredescribed with reference to the specific vector friendly instructionformat 700 in the context of the generic vector friendly instructionformat 600 for illustrative purposes, the invention is not limited tothe specific vector friendly instruction format 700 except whereclaimed. For example, the generic vector friendly instruction format 600contemplates a variety of possible sizes for the various fields, whilethe specific vector friendly instruction format 700 is shown as havingfields of specific sizes. By way of specific example, while the dataelement width field 664 is illustrated as a one bit field in thespecific vector friendly instruction format 700, the invention is not solimited (that is, the generic vector friendly instruction format 600contemplates other sizes of the data element width field 664).

The generic vector friendly instruction format 600 includes thefollowing fields listed below in the order illustrated in FIG. 7A.

EVEX Prefix (Bytes 0-3) 702—is encoded in a four-byte form.

Format Field 640 (EVEX Byte 0, bits [7:0])—the first byte (EVEX Byte 0)is the format field 640 and it contains 0x62 (the unique value used fordistinguishing the vector friendly instruction format in one embodimentof the invention).

The second-fourth bytes (EVEX Bytes 1-3) include a number of bit fieldsproviding specific capability.

REX field 705 (EVEX Byte 1, bits [7-5])—consists of a EVEX.R bit field(EVEX Byte 1, bit [7]—R), EVEX.X bit field (EVEX byte 1, bit [6]—X), and657BEX byte 1, bit[5]—B). The EVEX.R, EVEX.X, and EVEX.B bit fieldsprovide the same functionality as the corresponding VEX bit fields, andare encoded using is complement form, i.e. ZMMO is encoded as 1111B,ZMM15 is encoded as 0000B. Other fields of the instructions encode thelower three bits of the register indexes as is known in the art (rrr,xxx, and bbb), so that Rrrr, Xxxx, and Bbbb may be formed by addingEVEX.R, EVEX.X, and EVEX.B.

REX′ field 610—this is the first part of the REX' field 610 and is theEVEX.R′ bit field (EVEX Byte 1, bit [4]—R′) that is used to encodeeither the upper 16 or lower 16 of the extended 32 register set. In oneembodiment of the invention, this bit, along with others as indicatedbelow, is stored in bit inverted format to distinguish (in thewell-known x86 32-bit mode) from the BOUND instruction, whose realopcode byte is 62, but does not accept in the MOD R/M field (describedbelow) the value of 11 in the MOD field; alternative embodiments of theinvention do not store this and the other indicated bits below in theinverted format. A value of 1 is used to encode the lower 16 registers.In other words, R′Rrrr is formed by combining EVEX.R′, EVEX.R, and theother RRR from other fields.

Opcode map field 715 (EVEX byte 1, bits [3:0]—mmmm)—its content encodesan implied leading opcode byte (0F, 0F 38, or 0F 3).

Data element width field 664 (EVEX byte 2, bit [7]—W)—is represented bythe notation EVEX.W. EVEX.W is used to define the granularity (size) ofthe datatype (either 32-bit data elements or 64-bit data elements).

EVEX.vvvv 720 (EVEX Byte 2, bits [6:3]-vvvv)- the role of EVEX.vvvv mayinclude the following: 1) EVEX.vvvv encodes the first source registeroperand, specified in inverted (1s complement) form and is valid forinstructions with 2 or more source operands; 2) EVEX.vvvv encodes thedestination register operand, specified in 1s complement form forcertain vector shifts; or 3) EVEX.vvvv does not encode any operand, thefield is reserved and should contain 1111b. Thus, EVEX.vvvv field 720encodes the 4 low-order bits of the first source register specifierstored in inverted (1s complement) form. Depending on the instruction,an extra different EVEX bit field is used to extend the specifier sizeto 32 registers.

EVEX.U 668 Class field (EVEX byte 2, bit [2]-U)—If EVEX.0=0, itindicates class A or EVEX.U0; if EVEX.0=1, it indicates class B orEVEX.U1.

Prefix encoding field 725 (EVEX byte 2, bits [1:0]-pp)—providesadditional bits for the base operation field. In addition to providingsupport for the legacy SSE instructions in the EVEX prefix format, thisalso has the benefit of compacting the SIMD prefix (rather thanrequiring a byte to express the SIMD prefix, the EVEX prefix requiresonly 2 bits). In one embodiment, to support legacy SSE instructions thatuse a SIMD prefix (66H, F2H, F3H) in both the legacy format and in theEVEX prefix format, these legacy SIMD prefixes are encoded into the SIMDprefix encoding field; and at runtime are expanded into the legacy SIMDprefix prior to being provided to the decoder's PLA (so the PLA canexecute both the legacy and EVEX format of these legacy instructionswithout modification). Although newer instructions could use the EVEXprefix encoding field's content directly as an opcode extension, certainembodiments expand in a similar fashion for consistency but allow fordifferent meanings to be specified by these legacy SIMD prefixes. Analternative embodiment may redesign the PLA to support the 2 bit SIMDprefix encodings, and thus not require the expansion.

Alpha field 652 (EVEX byte 3, bit [7]—EH; also known as EVEX.EH,EVEX.rs, EVEX.RL, EVEX.write mask control, and EVEX.N; also illustratedwith α)—as previously described, this field is context specific.

Beta field 654 (EVEX byte 3, bits [6:4]-SSS, also known as EVEX.s2-0,EVEX.r2-0, EVEX.rr1, EVEX.LL0, EVEX.LLB; also illustrated with βββ)—aspreviously described, this field is context specific.

REX′ field 610—this is the remainder of the REX′ field and is theEVEX.V′ bit field (EVEX Byte 3, bit [3]—V′) that may be used to encodeeither the upper 16 or lower 16 of the extended 32 register set. Thisbit is stored in bit inverted format. A value of 1 is used to encode thelower 16 registers. In other words, V′VVVV is formed by combiningEVEX.V′, EVEX.vvvv.

Write mask field 670 (EVEX byte 3, bits [2:0]-kkk)—its content specifiesthe index of a register in the write mask registers as previouslydescribed. In one embodiment of the invention, the specific value EVEXkkk=000 has a special behavior implying no write mask is used for theparticular instruction (this may be implemented in a variety of waysincluding the use of a write mask hardwired to all ones or hardware thatbypasses the masking hardware).

Real Opcode Field 730 (Byte 4) is also known as the opcode byte. Part ofthe opcode is specified in this field.

MOD R/M Field 740 (Byte 5) includes MOD field 742, Reg field 744, andR/M field 746. As previously described, the MOD field's 742 contentdistinguishes between memory access and non-memory access operations.The role of Reg field 744 can be summarized to two situations: encodingeither the destination register operand or a source register operand, orbe treated as an opcode extension and not used to encode any instructionoperand. The role of R/M field 746 may include the following: encodingthe instruction operand that references a memory address, or encodingeither the destination register operand or a source register operand.

Scale, Index, Base (SIB) Byte (Byte 6)—As previously described, thescale field's 650 content is used for memory address generation. SIB.xxx754 and SIB.bbb 756—the contents of these fields have been previouslyreferred to with regard to the register indexes Xxxx and Bbbb.

Displacement field 662A (Bytes 7-10)—when MOD field 742 contains 10,bytes 7-10 are the displacement field 662A, and it works the same as thelegacy 32-bit displacement (disp32) and works at byte granularity.

Displacement factor field 662B (Byte 7)—when MOD field 742 contains10,byte 7 is the displacement factor field 662B. The location of thisfield is that same as that of the legacy x86 instruction set 8-bitdisplacement (disp8), which works at byte granularity. Since disp8 issign extended, it can only address between −128 and 127 bytes offsets;in terms of 64 byte cache lines, disp8 uses 8 bits that can be set toonly four really useful values −128, −64, 0, and 64; since a greaterrange is often needed, disp32 is used; however, disp32 requires 4 bytes.In contrast to disp8 and disp32, the displacement factor field 662B is areinterpretation of disp8; when using displacement factor field 662B,the actual displacement is determined by the content of the displacementfactor field multiplied by the size of the memory operand access (N).This type of displacement is referred to as disp8*N. This reduces theaverage instruction length (a single byte of used for the displacementbut with a much greater range). Such compressed displacement is based onthe assumption that the effective displacement is multiple of thegranularity of the memory access, and hence, the redundant low-orderbits of the address offset do not need to be encoded. In other words,the displacement factor field 662B substitutes the legacy x86instruction set 8-bit displacement. Thus, the displacement factor field662B is encoded the same way as an x86 instruction set 8-bitdisplacement (so no changes in the ModRM/SIB encoding rules) with theonly exception that disp8 is overloaded to disp8*N. In other words,there are no changes in the encoding rules or encoding lengths but onlyin the interpretation of the displacement value by hardware (which needsto scale the displacement by the size of the memory operand to obtain abyte-wise address offset).

Immediate field 672 operates as previously described.

Full Opcode Field

FIG. 7B is a block diagram illustrating the fields of the specificvector friendly instruction format 700 that make up the full opcodefield 674 according to one embodiment of the invention. Specifically,the full opcode field 674 includes the format field 640, the baseoperation field 642, and the data element width (W) field 664. The baseoperation field 642 includes the prefix encoding field 725, the opcodemap field 715, and the real opcode field 730.

Register Index Field

FIG. 7C is a block diagram illustrating the fields of the specificvector friendly instruction format 700 that make up the register indexfield 644 according to one embodiment of the invention. Specifically,the register index field 644 includes the REX field 705, the REX′ field710, the MODR/M.reg field 744, the MODR/M.r/m field 746, the VVVV field720, xxx field 754, and the bbb field 756.

Augmentation Operation Field

FIG. 7D is a block diagram illustrating the fields of the specificvector friendly instruction format 700 that make up the augmentationoperation field 650 according to one embodiment of the invention. Whenthe class (U) field 668 contains 0, it signifies EVEX.U0 (class A 668A);when it contains 1, it signifies EVEX.U1 (class B 668B). When U=0 andthe MOD field 742 contains 11 (signifying a no memory access operation),the alpha field 652 (EVEX byte 3, bit [7]—EH) is interpreted as the rsfield 652A. When the rs field 652A contains a 1 (round 652A.1), the betafield 654 (EVEX byte 3, bits [6:4]—SSS) is interpreted as the roundcontrol field 654A. The round control field 654A includes a one bit SAEfield 656 and a two bit round operation field 658. When the rs field652A contains a 0 (data transform 652A.2), the beta field 654 (EVEX byte3, bits [6:4]—SSS) is interpreted as a three bit data transform field654B. When U=0 and the MOD field 742 contains 00, 01, or 10 (signifyinga memory access operation), the alpha field 652 (EVEX byte 3, bit[7]—EH) is interpreted as the eviction hint (EH) field 652B and the betafield 654 (EVEX byte 3, bits [6:4]—SSS) is interpreted as a three bitdata manipulation field 654C.

When U=1, the alpha field 652 (EVEX byte 3, bit [7]—EH) is interpretedas the write mask control (Z) field 652C. When U=1 and the MOD field 742contains 11 (signifying a no memory access operation), part of the betafield 654 (EVEX byte 3, bit [4]-S0) is interpreted as the RL field 657A;when it contains a 1 (round 657A.1) the rest of the beta field 654 (EVEXbyte 3, bit [6-5]—S2-1) is interpreted as the round operation field659A, while when the RL field 657A contains a 0 (VSIZE 657.A2) the restof the beta field 654 (EVEX byte 3, bit [6-5]—S2-1) is interpreted asthe vector length field 659B (EVEX byte 3, bit [6-5]—L1-0). When U=1 andthe MOD field 742 contains 00, 01, or 10 (signifying a memory accessoperation), the beta field 654 (EVEX byte 3, bits [6:4]—SSS) isinterpreted as the vector length field 659B (EVEX byte 3, bit[6-5]—L1-0) and the broadcast field 657B (EVEX byte 3, bit [4]—B).

Exemplary Register Architecture

FIG. 8 is a block diagram of a register architecture 800 according toone embodiment of the invention. In the embodiment illustrated, thereare 32 vector registers 810 that are 512 bits wide; these registers arereferenced as zmm0 through zmm31. The lower order 256 bits of the lower16 zmm registers are overlaid on registers ymm0-16. The lower order 128bits of the lower 16 zmm registers (the lower order 128 bits of the ymmregisters) are overlaid on registers xmm0-15. The specific vectorfriendly instruction format 700 operates on these overlaid register fileas illustrated in the below tables.

Adjustable Vector Length Class Operations Registers Instruction A (FIG.6A; 610, 615, zmm registers Templates that U = 0) 625, 630 (the vectordo not include length is 64 byte) the vector length B (FIG. 6B; 612 zmmregisters field 659B U = 1) (the vector length is 64 byte) Instruction B(FIG. 6B; 617, 627 zmm, ymm, or Templates that U = 1) xmm registers doinclude the (the vector vector length length is 64 byte, field 659B 32byte, or 16 byte) depending on the vector length field 659B

In other words, the vector length field 659B selects between a maximumlength and one or more other shorter lengths, where each such shorterlength is half the length of the preceding length; and instructionstemplates without the vector length field 659B operate on the maximumvector length. Further, in one embodiment, the class B instructiontemplates of the specific vector friendly instruction format 700 operateon packed or scalar single/double-precision floating point data andpacked or scalar integer data. Scalar operations are operationsperformed on the lowest order data element position in an zmm/ymm/xmmregister; the higher order data element positions are either left thesame as they were prior to the instruction or zeroed depending on theembodiment.

Write mask registers 815—in the embodiment illustrated, there are 8write mask registers (k0 through k7), each 64 bits in size. In analternate embodiment, the write mask registers 815 are 16 bits in size.As previously described, in one embodiment of the invention, the vectormask register k0 cannot be used as a write mask; when the encoding thatwould normally indicate k0 is used for a write mask, it selects ahardwired write mask of 0xFFFF, effectively disabling write masking forthat instruction.

General-purpose registers 825—in the embodiment illustrated, there aresixteen 64-bit general-purpose registers that are used along with theexisting x86 addressing modes to address memory operands. Theseregisters are referenced by the names RAX, RBX, RCX, RDX, RBP, RSI, RDI,RSP, and R8 through R15.

Scalar floating point stack register file (x87 stack) 845, on which isaliased the MMX packed integer flat register file 850—in the embodimentillustrated, the x87 stack is an eight-element stack used to performscalar floating-point operations on 32/64/80-bit floating point datausing the x87 instruction set extension; while the MMX registers areused to perform operations on 64-bit packed integer data, as well as tohold operands for some operations performed between the MMX and XMMregisters.

Alternative embodiments of the invention may use wider or narrowerregisters. Additionally, alternative embodiments of the invention mayuse more, less, or different register files and registers.

Exemplary Core Architectures, Processors, and Computer Architectures

Processor cores may be implemented in different ways, for differentpurposes, and in different processors. For instance, implementations ofsuch cores may include: 1) a general purpose in-order core intended forgeneral-purpose computing; 2) a high performance general purposeout-of-order core intended for general-purpose computing; 3) a specialpurpose core intended primarily for graphics and/or scientific(throughput) computing. Implementations of different processors mayinclude: 1) a CPU including one or more general purpose in-order coresintended for general-purpose computing and/or one or more generalpurpose out-of-order cores intended for general-purpose computing; and2) a coprocessor including one or more special purpose cores intendedprimarily for graphics and/or scientific (throughput). Such differentprocessors lead to different computer system architectures, which mayinclude: 1) the coprocessor on a separate chip from the CPU; 2) thecoprocessor on a separate die in the same package as a CPU; 3) thecoprocessor on the same die as a CPU (in which case, such a coprocessoris sometimes referred to as special purpose logic, such as integratedgraphics and/or scientific (throughput) logic, or as special purposecores); and 4) a system on a chip that may include on the same die thedescribed CPU (sometimes referred to as the application core(s) orapplication processor(s)), the above described coprocessor, andadditional functionality. Exemplary core architectures are describednext, followed by descriptions of exemplary processors and computerarchitectures.

Exemplary Core Architectures

In-Order and Out-of-Order Core Block Diagram

FIG. 9A is a block diagram illustrating both an exemplary in-orderpipeline and an exemplary register renaming, out-of-orderissue/execution pipeline according to embodiments of the invention. FIG.9B is a block diagram illustrating both an exemplary embodiment of anin-order architecture core and an exemplary register renaming,out-of-order issue/execution architecture core to be included in aprocessor according to embodiments of the invention. The solid linedboxes in FIGS. 9A-B illustrate the in-order pipeline and in-order core,while the optional addition of the dashed lined boxes illustrates theregister renaming, out-of-order issue/execution pipeline and core. Giventhat the in-order aspect is a subset of the out-of-order aspect, theout-of-order aspect will be described.

In FIG. 9A, a processor pipeline 900 includes a fetch stage 902, alength decode stage 904, a decode stage 906, an allocation stage 908, arenaming stage 910, a scheduling (also known as a dispatch or issue)stage 912, a register read/memory read stage 914, an execute stage 916,a write back/memory write stage 918, an exception handling stage 922,and a commit stage 924.

FIG. 9B shows processor core 990 including a front end unit 930 coupledto an execution engine unit 950, and both are coupled to a memory unit970. The core 990 may be a reduced instruction set computing (RISC)core, a complex instruction set computing (CISC) core, a very longinstruction word (VLIW) core, or a hybrid or alternative core type. Asyet another option, the core 990 may be a special-purpose core, such as,for example, a network or communication core, compression engine,coprocessor core, general purpose computing graphics processing unit(GPGPU) core, graphics core, or the like.

The front end unit 930 includes a branch prediction unit 932 coupled toan instruction cache unit 934, which is coupled to an instructiontranslation lookaside buffer (TLB) 936, which is coupled to aninstruction fetch unit 938, which is coupled to a decode unit 940. Thedecode unit 940 (or decoder) may decode instructions, and generate as anoutput one or more micro-operations, micro-code entry points,microinstructions, other instructions, or other control signals, whichare decoded from, or which otherwise reflect, or are derived from, theoriginal instructions. The decode unit 940 may be implemented usingvarious different mechanisms. Examples of suitable mechanisms include,but are not limited to, look-up tables, hardware implementations,programmable logic arrays (PLAs), microcode read only memories (ROMs),etc. In one embodiment, the core 990 includes a microcode ROM or othermedium that stores microcode for certain macroinstructions (e.g., indecode unit 940 or otherwise within the front end unit 930). The decodeunit 940 is coupled to a rename/allocator unit 952 in the executionengine unit 950.

The execution engine unit 950 includes the rename/allocator unit 952coupled to a retirement unit 954 and a set of one or more schedulerunit(s) 956. The scheduler unit(s) 956 represents any number ofdifferent schedulers, including reservations stations, centralinstruction window, etc. The scheduler unit(s) 956 is coupled to thephysical register file(s) unit(s) 958. Each of the physical registerfile(s) units 958 represents one or more physical register files,different ones of which store one or more different data types, such asscalar integer, scalar floating point, packed integer, packed floatingpoint, vector integer, vector floating point, status (e.g., aninstruction pointer that is the address of the next instruction to beexecuted), etc. In one embodiment, the physical register file(s) unit958 comprises a vector registers unit, a write mask registers unit, anda scalar registers unit. These register units may provide architecturalvector registers, vector mask registers, and general purpose registers.The physical register file(s) unit(s) 958 is overlapped by theretirement unit 954 to illustrate various ways in which registerrenaming and out-of-order execution may be implemented (e.g., using areorder buffer(s) and a retirement register file(s); using a futurefile(s), a history buffer(s), and a retirement register file(s); using aregister maps and a pool of registers; etc.). The retirement unit 954and the physical register file(s) unit(s) 958 are coupled to theexecution cluster(s) 960. The execution cluster(s) 960 includes a set ofone or more execution units 962 and a set of one or more memory accessunits 964. The execution units 962 may perform various operations (e.g.,shifts, addition, subtraction, multiplication) and on various types ofdata (e.g., scalar floating point, packed integer, packed floatingpoint, vector integer, vector floating point). While some embodimentsmay include a number of execution units dedicated to specific functionsor sets of functions, other embodiments may include only one executionunit or multiple execution units that all perform all functions. Thescheduler unit(s) 956, physical register file(s) unit(s) 958, andexecution cluster(s) 960 are shown as being possibly plural becausecertain embodiments create separate pipelines for certain types ofdata/operations (e.g., a scalar integer pipeline, a scalar floatingpoint/packed integer/packed floating point/vector integer/vectorfloating point pipeline, and/or a memory access pipeline that each havetheir own scheduler unit, physical register file(s) unit, and/orexecution cluster—and in the case of a separate memory access pipeline,certain embodiments are implemented in which only the execution clusterof this pipeline has the memory access unit(s) 964). It should also beunderstood that where separate pipelines are used, one or more of thesepipelines may be out-of-order issue/execution and the rest in-order.

The set of memory access units 964 is coupled to the memory unit 970,which includes a data TLB unit 972 coupled to a data cache unit 974coupled to a level 2 (L2) cache unit 976. In one exemplary embodiment,the memory access units 964 may include a load unit, a store addressunit, and a store data unit, each of which is coupled to the data TLBunit 972 in the memory unit 970. The instruction cache unit 934 isfurther coupled to a level 2 (L2) cache unit 976 in the memory unit 970.The L2 cache unit 976 is coupled to one or more other levels of cacheand eventually to a main memory.

By way of example, the exemplary register renaming, out-of-orderissue/execution core architecture may implement the pipeline 900 asfollows: 1) the instruction fetch 938 performs the fetch and lengthdecoding stages 902 and 904; 2) the decode unit 940 performs the decodestage 906; 3) the rename/allocator unit 952 performs the allocationstage 908 and renaming stage 910; 4) the scheduler unit(s) 956 performsthe schedule stage 912; 5) the physical register file(s) unit(s) 958 andthe memory unit 970 perform the register read/memory read stage 914; theexecution cluster 960 perform the execute stage 916; 6) the memory unit970 and the physical register file(s) unit(s) 958 perform the writeback/memory write stage 918; 7) various units may be involved in theexception handling stage 922; and 8) the retirement unit 954 and thephysical register file(s) unit(s) 958 perform the commit stage 924.

The core 990 may support one or more instructions sets (e.g., the x86instruction set (with some extensions that have been added with newerversions); the MIPS instruction set of MIPS Technologies of Sunnyvale,Calif.; the ARM instruction set (with optional additional extensionssuch as NEON) of ARM Holdings of Sunnyvale, Calif.), including theinstruction(s) described herein. In one embodiment, the core 990includes logic to support a packed data instruction set extension (e.g.,AVX1, AVX2, and/or some form of the generic vector friendly instructionformat (U=0 and/or U=1) previously described), thereby allowing theoperations used by many multimedia applications to be performed usingpacked data.

It should be understood that the core may support multithreading(executing two or more parallel sets of operations or threads), and maydo so in a variety of ways including time sliced multithreading,simultaneous multithreading (where a single physical core provides alogical core for each of the threads that physical core issimultaneously multithreading), or a combination thereof (e.g., timesliced fetching and decoding and simultaneous multithreading thereaftersuch as in the Intel® Hyperthreading technology).

While register renaming is described in the context of out-of-orderexecution, it should be understood that register renaming may be used inan in-order architecture. While the illustrated embodiment of theprocessor also includes separate instruction and data cache units934/974 and a shared L2 cache unit 976, alternative embodiments may havea single internal cache for both instructions and data, such as, forexample, a Level 1 (L1) internal cache, or multiple levels of internalcache. In some embodiments, the system may include a combination of aninternal cache and an external cache that is external to the core and/orthe processor. Alternatively, all of the cache may be external to thecore and/or the processor.

Specific Exemplary In-Order Core Architecture

FIGS. 10A-B illustrate a block diagram of a more specific exemplaryin-order core architecture, which core would be one of several logicblocks (including other cores of the same type and/or different types)in a chip. The logic blocks communicate through a high-bandwidthinterconnect network (e.g., a ring network) with some fixed functionlogic, memory I/O interfaces, and other necessary I/O logic, dependingon the application.

FIG. 10A is a block diagram of a single processor core, along with itsconnection to the on-die interconnect network 1002 and with its localsubset of the Level 2 (L2) cache 1004, according to embodiments of theinvention. In one embodiment, an instruction decoder 1000 supports thex86 instruction set with a packed data instruction set extension. An L1cache 1006 allows low-latency accesses to cache memory into the scalarand vector units. While in one embodiment (to simplify the design), ascalar unit 1008 and a vector unit 1010 use separate register sets(respectively, scalar registers 1012 and vector registers 1014) and datatransferred between them is written to memory and then read back in froma level 1 (L1) cache 1006, alternative embodiments of the invention mayuse a different approach (e.g., use a single register set or include acommunication path that allow data to be transferred between the tworegister files without being written and read back).

The local subset of the L2 cache 1004 is part of a global L2 cache thatis divided into separate local subsets, one per processor core. Eachprocessor core has a direct access path to its own local subset of theL2 cache 1004. Data read by a processor core is stored in its L2 cachesubset 1004 and can be accessed quickly, in parallel with otherprocessor cores accessing their own local L2 cache subsets. Data writtenby a processor core is stored in its own L2 cache subset 1004 and isflushed from other subsets, if necessary. The ring network ensurescoherency for shared data. The ring network is bi-directional to allowagents such as processor cores, L2 caches and other logic blocks tocommunicate with each other within the chip. Each ring data-path is1012-bits wide per direction.

FIG. 10B is an expanded view of part of the processor core in FIG. 10Aaccording to embodiments of the invention. FIG. 10B includes an L1 datacache 1006A part of the L1 cache 1004, as well as more detail regardingthe vector unit 1010 and the vector registers 1014. Specifically, thevector unit 1010 is a 16-wide vector processing unit (VPU) (see the16-wide ALU 1028), which executes one or more of integer,single-precision float, and double-precision float instructions. The VPUsupports swizzling the register inputs with swizzle unit 1020, numericconversion with numeric convert units 1022A-B, and replication withreplication unit 1024 on the memory input. Write mask registers 1026allow predicating resulting vector writes.

Processor with Integrated Memory Controller and Graphics

FIG. 11 is a block diagram of a processor 1100 that may have more thanone core, may have an integrated memory controller, and may haveintegrated graphics according to embodiments of the invention. The solidlined boxes in FIG. 11 illustrate a processor 1100 with a single core1102A, a system agent 1110, a set of one or more bus controller units1116, while the optional addition of the dashed lined boxes illustratesan alternative processor 1100 with multiple cores 1102A-N, a set of oneor more integrated memory controller unit(s) 1114 in the system agentunit 1110, and special purpose logic 1108.

Thus, different implementations of the processor 1100 may include: 1) aCPU with the special purpose logic 1108 being integrated graphics and/orscientific (throughput) logic (which may include one or more cores), andthe cores 1102A-N being one or more general purpose cores (e.g., generalpurpose in-order cores, general purpose out-of-order cores, acombination of the two); 2) a coprocessor with the cores 1102A-N being alarge number of special purpose cores intended primarily for graphicsand/or scientific (throughput); and 3) a coprocessor with the cores1102A-N being a large number of general purpose in-order cores. Thus,the processor 1100 may be a general-purpose processor, coprocessor orspecial-purpose processor, such as, for example, a network orcommunication processor, compression engine, graphics processor, GPGPU(general purpose graphics processing unit), a high-throughput manyintegrated core (MIC) coprocessor (including 30 or more cores), embeddedprocessor, or the like. The processor may be implemented on one or morechips. The processor 1100 may be a part of and/or may be implemented onone or more substrates using any of a number of process technologies,such as, for example, BiCMOS, CMOS, or NMOS.

The memory hierarchy includes one or more levels of cache within thecores, a set or one or more shared cache units 1106, and external memory(not shown) coupled to the set of integrated memory controller units1114. The set of shared cache units 1106 may include one or moremid-level caches, such as level 2 (L2), level 3 (L3), level 4 (L4), orother levels of cache, a last level cache (LLC), and/or combinationsthereof. While in one embodiment a ring based interconnect unit 1112interconnects the integrated graphics logic 1108, the set of sharedcache units 1106, and the system agent unit 1110/integrated memorycontroller unit(s) 1114, alternative embodiments may use any number ofwell-known techniques for interconnecting such units. In one embodiment,coherency is maintained between one or more cache units 1106 and cores1102-A-N.

In some embodiments, one or more of the cores 1102A-N are capable ofmulti-threading. The system agent 1110 includes those componentscoordinating and operating cores 1102A-N. The system agent unit 1110 mayinclude for example a power control unit (PCU) and a display unit. ThePCU may be or include logic and components needed for regulating thepower state of the cores 1102A-N and the integrated graphics logic 1108.The display unit is for driving one or more externally connecteddisplays.

The cores 1102A-N may be homogenous or heterogeneous in terms ofarchitecture instruction set; that is, two or more of the cores 1102A-Nmay be capable of execution the same instruction set, while others maybe capable of executing only a subset of that instruction set or adifferent instruction set.

Exemplary Computer Architectures

FIGS. 12-15 are block diagrams of exemplary computer architectures.Other system designs and configurations known in the arts for laptops,desktops, handheld PCs, personal digital assistants, engineeringworkstations, servers, network devices, network hubs, switches, embeddedprocessors, digital signal processors (DSPs), graphics devices, videogame devices, set-top boxes, micro controllers, cell phones, portablemedia players, hand held devices, and various other electronic devices,are also suitable. In general, a huge variety of systems or electronicdevices capable of incorporating a processor and/or other executionlogic as disclosed herein are generally suitable.

Referring now to FIG. 12, shown is a block diagram of a system 1200 inaccordance with one embodiment of the present invention. The system 1200may include one or more processors 1210, 1215, which are coupled to acontroller hub 1220. In one embodiment the controller hub 1220 includesa graphics memory controller hub (GMCH) 1290 and an Input/Output Hub(IOH) 1250 (which may be on separate chips); the GMCH 1290 includesmemory and graphics controllers to which are coupled memory 1240 and acoprocessor 1245; the IOH 1250 is couples input/output (I/O) devices1260 to the GMCH 1290. Alternatively, one or both of the memory andgraphics controllers are integrated within the processor (as describedherein), the memory 1240 and the coprocessor 1245 are coupled directlyto the processor 1210, and the controller hub 1220 in a single chip withthe IOH 1250.

The optional nature of additional processors 1215 is denoted in FIG. 12with broken lines. Each processor 1210, 1215 may include one or more ofthe processing cores described herein and may be some version of theprocessor 1100.

The memory 1240 may be, for example, dynamic random access memory(DRAM), phase change memory (PCM), or a combination of the two. For atleast one embodiment, the controller hub 1220 communicates with theprocessor(s) 1210, 1215 via a multi-drop bus, such as a frontside bus(FSB), point-to-point interface such as QuickPath Interconnect (QPI), orsimilar connection 1295.

In one embodiment, the coprocessor 1245 is a special-purpose processor,such as, for example, a high-throughput MIC processor, a network orcommunication processor, compression engine, graphics processor, GPGPU,embedded processor, or the like. In one embodiment, controller hub 1220may include an integrated graphics accelerator.

There can be a variety of differences between the physical resources1210, 1215 in terms of a spectrum of metrics of merit includingarchitectural, microarchitectural, thermal, power consumptioncharacteristics, and the like.

In one embodiment, the processor 1210 executes instructions that controldata processing operations of a general type. Embedded within theinstructions may be coprocessor instructions. The processor 1210recognizes these coprocessor instructions as being of a type that shouldbe executed by the attached coprocessor 1245. Accordingly, the processor1210 issues these coprocessor instructions (or control signalsrepresenting coprocessor instructions) on a coprocessor bus or otherinterconnect, to coprocessor 1245. Coprocessor(s) 1245 accept andexecute the received coprocessor instructions.

Referring now to FIG. 13, shown is a block diagram of a first morespecific exemplary system 1300 in accordance with an embodiment of thepresent invention. As shown in FIG. 13, multiprocessor system 1300 is apoint-to-point interconnect system, and includes a first processor 1370and a second processor 1380 coupled via a point-to-point interconnect1350. Each of processors 1370 and 1380 may be some version of theprocessor 1100. In one embodiment of the invention, processors 1370 and1380 are respectively processors 1210 and 1215, while coprocessor 1338is coprocessor 1245. In another embodiment, processors 1370 and 1380 arerespectively processor 1210 coprocessor 1245.

Processors 1370 and 1380 are shown including integrated memorycontroller (IMC) units 1372 and 1382, respectively. Processor 1370 alsoincludes as part of its bus controller units point-to-point (P-P)interfaces 1376 and 1378; similarly, second processor 1380 includes P-Pinterfaces 1386 and 1388. Processors 1370, 1380 may exchange informationvia a point-to-point (P-P) interface 1350 using P-P interface circuits1378, 1388. As shown in FIG. 13, IMCs 1372 and 1382 couple theprocessors to respective memories, namely a memory 1332 and a memory1334, which may be portions of main memory locally attached to therespective processors.

Processors 1370, 1380 may each exchange information with a chipset 1390via individual P-P interfaces 1352, 1354 using point to point interfacecircuits 1376, 1394, 1386, 1398. Chipset 1390 may optionally exchangeinformation with the coprocessor 1338 via a high-performance interface1339. In one embodiment, the coprocessor 1338 is a special-purposeprocessor, such as, for example, a high-throughput MIC processor, anetwork or communication processor, compression engine, graphicsprocessor, GPGPU, embedded processor, or the like.

A shared cache (not shown) may be included in either processor oroutside of both processors, yet connected with the processors via P-Pinterconnect, such that either or both processors' local cacheinformation may be stored in the shared cache if a processor is placedinto a low power mode.

Chipset 1390 may be coupled to a first bus 1316 via an interface 1396.In one embodiment, first bus 1316 may be a Peripheral ComponentInterconnect (PCI) bus, or a bus such as a PCI Express bus or anotherthird generation I/O interconnect bus, although the scope of the presentinvention is not so limited.

As shown in FIG. 13, various I/O devices 1314 may be coupled to firstbus 1316, along with a bus bridge 1318 which couples first bus 1316 to asecond bus 1320. In one embodiment, one or more additional processor(s)1315, such as coprocessors, high-throughput MIC processors, GPGPU's,accelerators (such as, e.g., graphics accelerators or digital signalprocessing (DSP) units), field programmable gate arrays, or any otherprocessor, are coupled to first bus 1316. In one embodiment, second bus1320 may be a low pin count (LPC) bus. Various devices may be coupled toa second bus 1320 including, for example, a keyboard and/or mouse 1322,communication devices 1327 and a storage unit 1328 such as a disk driveor other mass storage device which may include instructions/code anddata 1330, in one embodiment. Further, an audio I/O 1324 may be coupledto the second bus 1320. Note that other architectures are possible. Forexample, instead of the point-to-point architecture of FIG. 13, a systemmay implement a multi-drop bus or other such architecture.

Referring now to FIG. 14, shown is a block diagram of a second morespecific exemplary system 1400 in accordance with an embodiment of thepresent invention. Like elements in FIGS. 13 and 14 bear like referencenumerals, and certain aspects of FIG. 13 have been omitted from FIG. 14in order to avoid obscuring other aspects of FIG. 14.

FIG. 14 illustrates that the processors 1370, 1380 may includeintegrated memory and I/O control logic (“CL”) 1372 and 1382,respectively. Thus, the CL 1372, 1382 include integrated memorycontroller units and include I/O control logic. FIG. 14 illustrates thatnot only are the memories 1332, 1334 coupled to the CL 1372, 1382, butalso that I/O devices 1414 are also coupled to the control logic 1372,1382. Legacy I/O devices 1415 are coupled to the chipset 1390.

Referring now to FIG. 15, shown is a block diagram of a SoC 1500 inaccordance with an embodiment of the present invention. Similar elementsin FIG. 11 bear like reference numerals. Also, dashed lined boxes areoptional features on more advanced SoCs. In FIG. 15, an interconnectunit(s) 1502 is coupled to: an application processor 1510 which includesa set of one or more cores 202A-N and shared cache unit(s) 1106; asystem agent unit 1110; a bus controller unit(s) 1116; an integratedmemory controller unit(s) 1114; a set or one or more coprocessors 1520which may include integrated graphics logic, an image processor, anaudio processor, and a video processor; an static random access memory(SRAM) unit 1530; a direct memory access (DMA) unit 1532; and a displayunit 1540 for coupling to one or more external displays. In oneembodiment, the coprocessor(s) 1520 include a special-purpose processor,such as, for example, a network or communication processor, compressionengine, GPGPU, a high-throughput MIC processor, embedded processor, orthe like.

Embodiments of the mechanisms disclosed herein may be implemented inhardware, software, firmware, or a combination of such implementationapproaches. Embodiments of the invention may be implemented as computerprograms or program code executing on programmable systems comprising atleast one processor, a storage system (including volatile andnon-volatile memory and/or storage elements), at least one input device,and at least one output device.

Program code, such as code 1330 illustrated in FIG. 13, may be appliedto input instructions to perform the functions described herein andgenerate output information. The output information may be applied toone or more output devices, in known fashion. For purposes of thisapplication, a processing system includes any system that has aprocessor, such as, for example; a digital signal processor (DSP), amicrocontroller, an application specific integrated circuit (ASIC), or amicroprocessor.

The program code may be implemented in a high level procedural or objectoriented programming language to communicate with a processing system.The program code may also be implemented in assembly or machinelanguage, if desired. In fact, the mechanisms described herein are notlimited in scope to any particular programming language. In any case,the language may be a compiled or interpreted language.

One or more aspects of at least one embodiment may be implemented byrepresentative instructions stored on a machine-readable medium whichrepresents various logic within the processor, which when read by amachine causes the machine to fabricate logic to perform the techniquesdescribed herein. Such representations, known as “IP cores” may bestored on a tangible, machine readable medium and supplied to variouscustomers or manufacturing facilities to load into the fabricationmachines that actually make the logic or processor.

Such machine-readable storage media may include, without limitation,non-transitory, tangible arrangements of articles manufactured or formedby a machine or device, including storage media such as hard disks, anyother type of disk including floppy disks, optical disks, compact diskread-only memories (CD-ROMs), compact disk rewritable's (CD-RWs), andmagneto-optical disks, semiconductor devices such as read-only memories(ROMs), random access memories (RAMs) such as dynamic random accessmemories (DRAMs), static random access memories (SRAMs), erasableprogrammable read-only memories (EPROMs), flash memories, electricallyerasable programmable read-only memories (EEPROMs), phase change memory(PCM), magnetic or optical cards, or any other type of media suitablefor storing electronic instructions.

Accordingly, embodiments of the invention also include non-transitory,tangible machine-readable media containing instructions or containingdesign data, such as Hardware Description Language (HDL), which definesstructures, circuits, apparatuses, processors and/or system featuresdescribed herein. Such embodiments may also be referred to as programproducts.

Emulation (including Binary Translation, Code Morphing, etc.)

In some cases, an instruction converter may be used to convert aninstruction from a source instruction set to a target instruction set.For example, the instruction converter may translate (e.g., using staticbinary translation, dynamic binary translation including dynamiccompilation), morph, emulate, or otherwise convert an instruction to oneor more other instructions to be processed by the core. The instructionconverter may be implemented in software, hardware, firmware, or acombination thereof. The instruction converter may be on processor, offprocessor, or part on and part off processor.

FIG. 16 is a block diagram contrasting the use of a software instructionconverter to convert binary instructions in a source instruction set tobinary instructions in a target instruction set according to embodimentsof the invention. In the illustrated embodiment, the instructionconverter is a software instruction converter, although alternativelythe instruction converter may be implemented in software, firmware,hardware, or various combinations thereof. FIG. 16 shows a program in ahigh level language 1602 may be compiled using an x86 compiler 1604 togenerate x86 binary code 1606 that may be natively executed by aprocessor with at least one x86 instruction set core 1616. The processorwith at least one x86 instruction set core 1616 represents any processorthat can perform substantially the same functions as an Intel processorwith at least one x86 instruction set core by compatibly executing orotherwise processing (1) a substantial portion of the instruction set ofthe Intel x86 instruction set core or (2) object code versions ofapplications or other software targeted to run on an Intel processorwith at least one x86 instruction set core, in order to achievesubstantially the same result as an Intel processor with at least onex86 instruction set core. The x86 compiler 1604 represents a compilerthat is operable to generate x86 binary code 1606 (e.g., object code)that can, with or without additional linkage processing, be executed onthe processor with at least one x86 instruction set core 1616.Similarly, FIG. 16 shows the program in the high level language 1602 maybe compiled using an alternative instruction set compiler 1608 togenerate alternative instruction set binary code 1610 that may benatively executed by a processor without at least one x86 instructionset core 1614 (e.g., a processor with cores that execute the MIPSinstruction set of MIPS Technologies of Sunnyvale, Calif. and/or thatexecute the ARM instruction set of ARM Holdings of Sunnyvale, Calif.).The instruction converter 1612 is used to convert the x86 binary code1606 into code that may be natively executed by the processor without anx86 instruction set core 1614. This converted code is not likely to bethe same as the alternative instruction set binary code 1610 because aninstruction converter capable of this is difficult to make; however, theconverted code will accomplish the general operation and be made up ofinstructions from the alternative instruction set. Thus, the instructionconverter 1612 represents software, firmware, hardware, or a combinationthereof that, through emulation, simulation or any other process, allowsa processor or other electronic device that does not have an x86instruction set processor or core to execute the x86 binary code 1606.

1.-20. (canceled)
 21. An apparatus comprising: a decoder to decode afirst instruction with a first field into a decoded first instruction, asecond instruction with a second field into a decoded secondinstruction, a third instruction with a third field into a decoded thirdinstruction, and a fourth instruction with a fourth field into a decodedfourth instruction; instruction execution circuitry to execute: a) thedecoded first instruction with the first field and the decoded secondinstruction with the second field, where both said first instruction andsaid second instruction select a first group of input vector elementsfrom one of multiple first non-overlapping sections of respective firstand second single input vectors, said first group having a first bitwidth, each of said multiple first non-overlapping sections having asame bit width as said first group, and b) the decoded third instructionwith the third field and the decoded fourth instruction with the fourthfield, where both said third instruction and said fourth instructionselect a second group of input vector elements from one of multiplesecond non-overlapping sections of respective third and fourth singleinput vectors, said second group having a second bit width that islarger than said first bit width, each of said multiple secondnon-overlapping sections having a same bit width as said second group;and masking layer circuitry to mask said first and second groups of saidfirst and third instructions at a first granularity specified by thefirst field and the third field, respectively, with respectiveresultants produced therewith being respective resultants of said firstand third instructions, and mask said first and second groups of saidsecond and fourth instructions at a second granularity specified by thesecond field and the fourth field, respectively, with respectiveresultants produced therewith being respective resultants of said secondand fourth instructions.
 22. The apparatus of claim 21, wherein saidsecond group is twice as large as said first group.
 23. The apparatus ofclaim 22, wherein said first group is 128 bits and said second group is256 bits.
 24. The apparatus of claim 21, wherein said first granularityis 32 bits and said second granularity is 64 bits.
 25. The apparatus ofclaim 21, wherein said vector elements are floating point data values.26. The apparatus of claim 21, wherein said masking layer circuitrypermits an element in a destination vector to remain if the element'slocation is masked.
 27. The apparatus of claim 21, wherein said maskinglayer circuitry overwrites an element in a destination vector with afixed value if the element's location is masked.
 28. A methodcomprising: decoding a first instruction into a decoded firstinstruction, a second instruction into a decoded second instruction, athird instruction into a decoded third instruction, and a fourthinstruction into a decoded fourth instruction; executing the decodedfirst instruction including selecting a first group of input vectorelements from one of multiple first non-overlapping sections of a firstsingle input vector, said first group having a first bit width, each ofsaid multiple first non-overlapping sections having a same bit width assaid first group, and masking said selected first group at a firstgranularity specified by a first field of the first instruction;executing the decoded second instruction including selecting a secondgroup of input vector elements from one of multiple secondnon-overlapping sections of a second single input vector, said secondgroup having said first bit width, each of said multiple secondnon-overlapping sections of said second single input vector having asame bit width as said first group, and masking said selected secondgroup at a second granularity specified by a second field of the secondinstruction, said first granularity being finer than said secondgranularity; executing the decoded third instruction including selectinga third group of input vector elements from one of multiple thirdnon-overlapping sections of a third single input vector, said thirdgroup having a second bit width, each of said multiple thirdnon-overlapping sections having a same bit width as said third group,said second bit width larger than said first bit width, and masking saidselected third group at said second granularity specified by a thirdfield of the third instruction; and executing the decoded fourthinstruction including selecting a fourth group of input vector elementsfrom one of multiple fourth non-overlapping sections of a fourth singleinput vector, said fourth group having said second bit width, each ofsaid multiple fourth non-overlapping sections of said fourth singleinput vector having a same bit width as said third group, and maskingsaid fourth group at said first granularity specified by a fourth fieldof the fourth instruction.
 29. The method of claim 28, wherein saidfirst, second, third, and fourth instructions are executed by a sameexecution unit within an instruction execution pipeline.
 30. The methodof claim 28, wherein said second group is twice as large as said firstgroup.
 31. The method of claim 30, wherein said first group is 128 bitsand said second group is 256 bits.
 32. The method of claim 28, whereinsaid first granularity is 32 bits and said second granularity is 64bits.
 33. The method of claim 28, wherein said vector elements arefloating point data values.
 34. The method of claim 28, wherein saidmasking includes any of: i) permitting an element in a destinationvector to remain if the element's location is masked, or ii) overwritingan element in a destination vector with a fixed value if the element'slocation is masked.
 35. The method of claim 28, wherein said maskingincludes any of: i) permitting an element in a destination vector toremain if the element's location is masked, or ii) overwriting anelement in a destination vector with a fixed value if the element'slocation is masked.
 36. An apparatus comprising: a decoder to decode afirst instruction into a decoded first instruction, a second instructioninto a decoded second instruction, a third instruction into a decodedthird instruction, and a fourth instruction into a decoded fourthinstruction; instruction execution circuitry to execute: a) the decodedfirst instruction and the decoded second instruction, where both saidfirst instruction and said second instruction select, in accordance withfirst and second respective fields, a first group of input vectorelements from one of multiple first non-overlapping sections ofrespective first and second single input vectors, said first grouphaving a first bit width, each of said multiple first non-overlappingsections having a same bit width as said first group, and b) the decodedthird instruction and the decoded fourth instruction, where both saidthird instruction and said fourth instruction select, in accordance withthird and fourth respective fields, a second group of input vectorelements from one of multiple second non-overlapping sections ofrespective third and fourth single input vectors, said second grouphaving a second bit width that is larger than said first bit width, eachof said multiple second non-overlapping sections having a same bit widthas said second group; and masking layer circuitry to mask said first andsecond groups of said first and third instructions at a firstgranularity in accordance with the first and third respective fields,with respective resultants produced therewith being respectiveresultants of said first and third instructions, and mask said first andsecond groups of said second and fourth instructions at a secondgranularity in accordance with the second and fourth respective fields,with respective resultants produced therewith being respectiveresultants of said second and fourth instructions.
 37. The apparatus ofclaim 36, wherein said second group is twice as large as said firstgroup.
 38. The apparatus of claim 37, wherein said first group is 128bits and said second group is 256 bits.
 39. The apparatus of claim 36,wherein said first granularity is 32 bits and said second granularity is64 bits.
 40. The apparatus of claim 36, wherein said vector elements arefloating point data values.